fix more linting issues

main
Cameron Clough 2022-01-07 15:52:41 +00:00
parent e4bd1c8adf
commit 2f9e5e905a
No known key found for this signature in database
GPG Key ID: BFB3B74B026ED43F
6 changed files with 26 additions and 30 deletions

View File

@ -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>
);
}

View File

@ -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%' }}>

View File

@ -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'
/*

View File

@ -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])

View File

@ -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!"

View File

@ -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%' }}>