diff --git a/package-lock.json b/package-lock.json index eb7d904..0e4f8f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "mui-tel-input": "^7.0.0", "notistack": "^3.0.1", "openweathermap-ts": "^1.2.10", - "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#staging", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#master", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", diff --git a/src/app/UserWrapper.tsx b/src/app/UserWrapper.tsx index 722705e..cb4cdf8 100644 --- a/src/app/UserWrapper.tsx +++ b/src/app/UserWrapper.tsx @@ -82,7 +82,20 @@ export default function UserWrapper(props: Props) { firmware: new Map() }) }).catch(() => { - setGlobal(globalDefault) + userAPI.getUser(user_id).then(user => { + setGlobal({ + user: user ? user : User.create(), + team: globalDefault.team, + as: "", + showErrors: false, + userTeamPermissions: [], + backgroundTasksComplete: false, + firmware: new Map() + }) + }).catch(() => { + setGlobal(globalDefault) + }) + }) .finally(() => { setLoading(false)