mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 03:16:22 -05:00
Wrapping most API requests in trys/catches.
This commit is contained in:
parent
8ab61bd8a8
commit
6a654cd3af
10 changed files with 355 additions and 123 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import React from "react";
|
||||
import {HelpPopup, humanFileSize, minutesToTimestamp, PageContainer, TabLinks, WROLModeMessage} from "./Common";
|
||||
import {HelpPopup, humanFileSize, PageContainer, TabLinks, WROLModeMessage} from "./Common";
|
||||
import {Route} from "react-router-dom";
|
||||
import {getMapImportStatus, importMapFiles} from "../api";
|
||||
import Table from "semantic-ui-react/dist/commonjs/collections/Table";
|
||||
|
|
@ -28,13 +28,17 @@ class ManageMap extends React.Component {
|
|||
}
|
||||
|
||||
fetchImportStatus = async () => {
|
||||
const importStatus = await getMapImportStatus();
|
||||
this.setState({
|
||||
files: importStatus['files'],
|
||||
importing: importStatus['importing'],
|
||||
import_running: importStatus['import_running'],
|
||||
dockerized: importStatus['dockerized'],
|
||||
});
|
||||
try {
|
||||
const importStatus = await getMapImportStatus();
|
||||
this.setState({
|
||||
files: importStatus['files'],
|
||||
importing: importStatus['importing'],
|
||||
import_running: importStatus['import_running'],
|
||||
dockerized: importStatus['dockerized'],
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
import = async (e) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue