hotifx: added more snackbars and some details to help debug reon

This commit is contained in:
Carter 2025-12-22 20:49:54 -06:00
parent 8238c4df58
commit 128a06e0a0
3 changed files with 12 additions and 5 deletions

View file

@ -12,6 +12,7 @@ import { makeStyles } from '@mui/styles'
import { CssBaseline, Theme } from '@mui/material' import { CssBaseline, Theme } from '@mui/material'
import { AppThemeProvider } from 'theme/AppThemeProvider' import { AppThemeProvider } from 'theme/AppThemeProvider'
import HTTPProvider from 'providers/http' import HTTPProvider from 'providers/http'
import { useSnackbar } from 'hooks'
// import FirmwareLoader from './FirmwareLoader' // import FirmwareLoader from './FirmwareLoader'
const reducer = (state: GlobalState, action: GlobalStateAction): GlobalState => { const reducer = (state: GlobalState, action: GlobalStateAction): GlobalState => {
@ -64,6 +65,7 @@ export default function UserWrapper(props: Props) {
const useAuth = useAuth0(); const useAuth = useAuth0();
const hasFetched = useRef(false); const hasFetched = useRef(false);
const [global, setGlobal] = useState<undefined | GlobalState>(undefined) const [global, setGlobal] = useState<undefined | GlobalState>(undefined)
const snackbar = useSnackbar()
const user_id = or(useAuth.user?.sub, "") const user_id = or(useAuth.user?.sub, "")
@ -81,7 +83,8 @@ export default function UserWrapper(props: Props) {
backgroundTasksComplete: false, backgroundTasksComplete: false,
firmware: new Map() firmware: new Map()
}) })
}).catch(() => { }).catch((err) => {
snackbar.error("get user and team: "+err)
userAPI.getUser(user_id).then(user => { userAPI.getUser(user_id).then(user => {
setGlobal({ setGlobal({
user: user ? user : User.create(), user: user ? user : User.create(),
@ -92,7 +95,8 @@ export default function UserWrapper(props: Props) {
backgroundTasksComplete: false, backgroundTasksComplete: false,
firmware: new Map() firmware: new Map()
}) })
}).catch(() => { }).catch((err) => {
snackbar.error("get user: "+err)
setGlobal(globalDefault) setGlobal(globalDefault)
}) })

View file

@ -199,6 +199,7 @@ export default function Bins(props: Props) {
const [cardValDisplay, setCardValDisplay] = useState<"high" | "low" | "average">("high"); const [cardValDisplay, setCardValDisplay] = useState<"high" | "low" | "average">("high");
const [teamsDialog, setTeamsDialog] = useState(false) const [teamsDialog, setTeamsDialog] = useState(false)
const snackbar = useSnackbar()
// const [scrollTranslations, setScrollTranslations] = useState({ // const [scrollTranslations, setScrollTranslations] = useState({
// bins: 0, // bins: 0,
@ -265,6 +266,8 @@ export default function Bins(props: Props) {
// console.log("should?") // console.log("should?")
setTeamsDialog(true) setTeamsDialog(true)
} }
}).catch(err => {
snackbar.error("error listing teams: "+err)
}) })
} }
}, [doneLoadingPage, grainBins, grainBags]) }, [doneLoadingPage, grainBins, grainBags])

View file

@ -158,9 +158,9 @@ export default function DevicePage() {
if (length > 0) { if (length > 0) {
warningString = warningString + " through " + getContextTypes()[length - 1]; warningString = warningString + " through " + getContextTypes()[length - 1];
} }
snackbar.warning(warningString); snackbar.warning("page data warning: "+warningString);
} else { } else {
snackbar.error(err); snackbar.error("page data error: "+err);
} }
}) })
.finally(() => setLoading(false)); .finally(() => setLoading(false));
@ -174,7 +174,7 @@ export default function DevicePage() {
} }
}) })
.catch(err => { .catch(err => {
console.log(err) console.log("load port scan: "+err)
}) })
} }