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();
useEffect(() => {
const main = async () => {
const key: string = getKey(SESSION_KEYS.ENCRYPTION_KEY);
const keyAttributes: KeyAttributes = getData(
LS_KEYS.ORIGINAL_KEY_ATTRIBUTES,
);
const user: User = getData(LS_KEYS.USER);
setUser(user);
if (!user?.token) {
void router.push("/");
} else if (key) {
if (justSignedUp()) {
setOpenRecoveryKey(true);
setLoading(false);
} else {
void router.push(appHomeRoute);
}
} else if (keyAttributes?.encryptedKey) {
void router.push(PAGES.CREDENTIALS);
} else {
setToken(user.token);
const key: string = getKey(SESSION_KEYS.ENCRYPTION_KEY);
const keyAttributes: KeyAttributes = getData(
LS_KEYS.ORIGINAL_KEY_ATTRIBUTES,
);
const user: User = getData(LS_KEYS.USER);
setUser(user);
if (!user?.token) {
void router.push("/");
} else if (key) {
if (justSignedUp()) {
setOpenRecoveryKey(true);
setLoading(false);
} else {
void router.push(appHomeRoute);
}
};
void main();
} else if (keyAttributes?.encryptedKey) {
void router.push(PAGES.CREDENTIALS);
} else {
setToken(user.token);
setLoading(false);
}
appContext.showNavBar(true);
}, []);

View File

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

View File

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