hotifx: added more snackbars and some details to help debug reon
This commit is contained in:
parent
8238c4df58
commit
128a06e0a0
3 changed files with 12 additions and 5 deletions
|
|
@ -12,6 +12,7 @@ import { makeStyles } from '@mui/styles'
|
|||
import { CssBaseline, Theme } from '@mui/material'
|
||||
import { AppThemeProvider } from 'theme/AppThemeProvider'
|
||||
import HTTPProvider from 'providers/http'
|
||||
import { useSnackbar } from 'hooks'
|
||||
// import FirmwareLoader from './FirmwareLoader'
|
||||
|
||||
const reducer = (state: GlobalState, action: GlobalStateAction): GlobalState => {
|
||||
|
|
@ -64,6 +65,7 @@ export default function UserWrapper(props: Props) {
|
|||
const useAuth = useAuth0();
|
||||
const hasFetched = useRef(false);
|
||||
const [global, setGlobal] = useState<undefined | GlobalState>(undefined)
|
||||
const snackbar = useSnackbar()
|
||||
|
||||
const user_id = or(useAuth.user?.sub, "")
|
||||
|
||||
|
|
@ -81,7 +83,8 @@ export default function UserWrapper(props: Props) {
|
|||
backgroundTasksComplete: false,
|
||||
firmware: new Map()
|
||||
})
|
||||
}).catch(() => {
|
||||
}).catch((err) => {
|
||||
snackbar.error("get user and team: "+err)
|
||||
userAPI.getUser(user_id).then(user => {
|
||||
setGlobal({
|
||||
user: user ? user : User.create(),
|
||||
|
|
@ -92,7 +95,8 @@ export default function UserWrapper(props: Props) {
|
|||
backgroundTasksComplete: false,
|
||||
firmware: new Map()
|
||||
})
|
||||
}).catch(() => {
|
||||
}).catch((err) => {
|
||||
snackbar.error("get user: "+err)
|
||||
setGlobal(globalDefault)
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue