imported logos, header displays logo based on whiteLabel
This commit is contained in:
parent
0d5d2e821f
commit
95a1ba486b
214 changed files with 290 additions and 193 deletions
|
|
@ -17,6 +17,7 @@ export default function UserWrapper() {
|
|||
const useAuth = useAuth0();
|
||||
const hasFetched = useRef(false);
|
||||
const [user, setUser] = useState<pond.User | undefined>(undefined)
|
||||
const [message, setMessage] = useState("Loading user profile...")
|
||||
|
||||
let user_id = or(useAuth.user?.sub, "")
|
||||
|
||||
|
|
@ -24,8 +25,15 @@ export default function UserWrapper() {
|
|||
if (hasFetched.current) return;
|
||||
setLoading(true)
|
||||
userAPI.getUser(user_id).then(resp => {
|
||||
setUser(resp)
|
||||
}).finally(() => {
|
||||
setUser(resp)
|
||||
}).catch(err => {
|
||||
if (err.toString().includes("CORS")) {
|
||||
setMessage("CORS error")
|
||||
} else {
|
||||
setMessage("Loading failed, refresh may help")
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
setLoading(false)
|
||||
hasFetched.current = true;
|
||||
})
|
||||
|
|
@ -38,7 +46,7 @@ export default function UserWrapper() {
|
|||
|
||||
if (!user || loading) return (
|
||||
<LoadingScreen
|
||||
message={"Loading user profile..."}
|
||||
message={message}
|
||||
/>
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue