fix: frontend: warning message shouldn't appear unless already logged in
Massimo Melina committed
Feb 20, 2023 at 09:02 UTC
76532fd2f884d400ab1e6a89895b04ba89022fe2
1 file changed
+2
-2
frontend/src/useFetchList.ts
+2
-2
@@ -84,8 +84,8 @@ export default function useFetchList() {
84
if (error) {
85
state.stopSearch?.()
86
state.error = (ERRORS as any)[error] || String(error)
87
- if (error === 401)
88
- await alertDialog(t('wrong_account', "This account has no access, try another"), 'warning')
87
+ if (error === 401 && snap.username)
88
+ await alertDialog(t('wrong_account', { u: snap.username }, "Account {u} has no access, try another"), 'warning')
89
state.loginRequired = error === 401
90
lastReq.current = null
91
return