fix more linting issues
parent
e4bd1c8adf
commit
2f9e5e905a
26
src/App.js
26
src/App.js
|
@ -37,31 +37,29 @@ function App() {
|
|||
mode: window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light',
|
||||
},
|
||||
}),
|
||||
[true],
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="App">
|
||||
|
||||
<ThemeProvider theme={theme}>
|
||||
<CssBaseline />
|
||||
|
||||
<UserProvider>
|
||||
<DeviceStore>
|
||||
<ToastStore>
|
||||
<ThemeProvider theme={theme}>
|
||||
<CssBaseline />
|
||||
|
||||
<GlobalSnack />
|
||||
<UserProvider>
|
||||
<DeviceStore>
|
||||
<ToastStore>
|
||||
|
||||
{session ? <UserAdmin/> : <Login />}
|
||||
<GlobalSnack />
|
||||
|
||||
</ToastStore>
|
||||
</DeviceStore>
|
||||
{session ? <UserAdmin /> : <Login />}
|
||||
|
||||
</UserProvider>
|
||||
</ToastStore>
|
||||
</DeviceStore>
|
||||
|
||||
</UserProvider>
|
||||
</ThemeProvider>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -33,18 +33,18 @@ function loading() {
|
|||
|
||||
export default function EnhancedTable(props) {
|
||||
const [state, dispatch] = useContext(DeviceContext)
|
||||
const [ notifState, notifdispatch ] = useContext(SnackbarContext)
|
||||
const [, notifDispatch] = useContext(SnackbarContext)
|
||||
|
||||
useEffect(() => {
|
||||
deviceController.getBootlogs(props.dongleId).then((res) => {
|
||||
setTimeout(() => {
|
||||
dispatch({ type: "update_dongle_bootlogs", dongle_id: props.dongleId, bootlogs: res.data })
|
||||
}, 1)
|
||||
}).catch((err) => {
|
||||
notifdispatch({type: "NEW_TOAST", msg: 'Failed to load bootlogs'})
|
||||
}).catch(() => {
|
||||
notifDispatch({type: "NEW_TOAST", msg: 'Failed to load bootlogs'})
|
||||
})
|
||||
|
||||
}, []);
|
||||
}, [dispatch, notifDispatch, props.dongleId])
|
||||
|
||||
return (
|
||||
<Box sx={{ width: '100%' }}>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import Box from '@mui/material/Box';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import React, { useContext } from 'react';
|
||||
|
||||
//import { JsonFormatter } from 'react-json-formatter'
|
||||
|
||||
/*
|
||||
|
|
|
@ -75,8 +75,7 @@ export default function EnhancedTable(props) {
|
|||
deviceController.getCrashlogs(props.dongleId).then((res) => {
|
||||
dispatch({ type: "update_dongle_bootlogs", dongle_id: props.dongleId, bootlogs: res.data })
|
||||
})
|
||||
|
||||
}, []);
|
||||
}, [dispatch, props.dongleId]);
|
||||
|
||||
console.log("drives", state.dongles[props.dongleId])
|
||||
console.log("drives", typeof state.dongles[props.dongleId])
|
||||
|
|
|
@ -19,17 +19,17 @@ import * as helpers from "./../../../controllers/helpers"
|
|||
export default function SignIn(props) {
|
||||
|
||||
const [state] = useContext(DeviceContext)
|
||||
const [notifState, notifdispatch] = useContext(SnackbarContext)
|
||||
const [, notifDispatch] = useContext(SnackbarContext)
|
||||
|
||||
function pubKeyClipboard(newClip) {
|
||||
navigator.clipboard.writeText(newClip).then(function () {
|
||||
notifdispatch({
|
||||
notifDispatch({
|
||||
type: "NEW_TOAST",
|
||||
open: true,
|
||||
msg: "Successfully copied to clipboard!"
|
||||
})
|
||||
}, function () {
|
||||
notifdispatch({
|
||||
notifDispatch({
|
||||
type: "NEW_TOAST",
|
||||
open: true,
|
||||
msg: "Failed to write to clipboard!"
|
||||
|
|
|
@ -25,7 +25,7 @@ import ViewDrive from "./view_drive"
|
|||
|
||||
export default function EnhancedTable(props) {
|
||||
const [deviceState, dispatch] = useContext(DeviceContext)
|
||||
const [ notifState, notifdispatch ] = useContext(SnackbarContext)
|
||||
const [, notifDispatch] = useContext(SnackbarContext)
|
||||
const [state, setState] = useState({selectedSegment: null})
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -33,11 +33,10 @@ export default function EnhancedTable(props) {
|
|||
setTimeout(() => {
|
||||
dispatch({ type: "update_dongle_drive", dongle_id: props.dongleId, drives: res.data })
|
||||
}, 1)
|
||||
}).catch((err) => {
|
||||
notifdispatch({type: "NEW_TOAST", msg: 'Failed to load drives'})
|
||||
}).catch(() => {
|
||||
notifDispatch({type: "NEW_TOAST", msg: 'Failed to load drives'})
|
||||
})
|
||||
|
||||
}, []);
|
||||
}, [dispatch, notifDispatch, props.dongleId])
|
||||
|
||||
return (
|
||||
<Box sx={{ width: '100%' }}>
|
||||
|
|
Loading…
Reference in New Issue