Apply lints

This commit is contained in:
Manav Rathi 2024-11-20 09:38:35 +05:30
parent 3d3ee1bb6f
commit 04a8bd6209
No known key found for this signature in database
3 changed files with 22 additions and 24 deletions

View File

@ -43,30 +43,27 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
const router = useRouter(); const router = useRouter();
useEffect(() => { useEffect(() => {
const main = async () => { const key: string = getKey(SESSION_KEYS.ENCRYPTION_KEY);
const key: string = getKey(SESSION_KEYS.ENCRYPTION_KEY); const keyAttributes: KeyAttributes = getData(
const keyAttributes: KeyAttributes = getData( LS_KEYS.ORIGINAL_KEY_ATTRIBUTES,
LS_KEYS.ORIGINAL_KEY_ATTRIBUTES, );
); const user: User = getData(LS_KEYS.USER);
const user: User = getData(LS_KEYS.USER); setUser(user);
setUser(user); if (!user?.token) {
if (!user?.token) { void router.push("/");
void router.push("/"); } else if (key) {
} else if (key) { if (justSignedUp()) {
if (justSignedUp()) { setOpenRecoveryKey(true);
setOpenRecoveryKey(true);
setLoading(false);
} else {
void router.push(appHomeRoute);
}
} else if (keyAttributes?.encryptedKey) {
void router.push(PAGES.CREDENTIALS);
} else {
setToken(user.token);
setLoading(false); setLoading(false);
} else {
void router.push(appHomeRoute);
} }
}; } else if (keyAttributes?.encryptedKey) {
void main(); void router.push(PAGES.CREDENTIALS);
} else {
setToken(user.token);
setLoading(false);
}
appContext.showNavBar(true); appContext.showNavBar(true);
}, []); }, []);

View File

@ -142,7 +142,7 @@ export const isPasskeyRecoveryEnabled = async () => {
throw Error("request failed"); throw Error("request failed");
} }
return resp.data["isPasskeyRecoveryEnabled"] as boolean; return resp.data.isPasskeyRecoveryEnabled as boolean;
} catch (e) { } catch (e) {
log.error("failed to get passkey recovery status", e); log.error("failed to get passkey recovery status", e);
throw e; throw e;
@ -194,7 +194,7 @@ const getAccountsToken = async () => {
"X-Auth-Token": token, "X-Auth-Token": token,
}, },
); );
return resp.data["accountsToken"]; return resp.data.accountsToken;
}; };
/** /**

View File

@ -154,6 +154,7 @@ export const generateSRPClient = async (
resolve(srpClient); resolve(srpClient);
} catch (e) { } catch (e) {
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
reject(e); reject(e);
} }
}); });