mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
Apply lints
This commit is contained in:
parent
3d3ee1bb6f
commit
04a8bd6209
@ -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);
|
||||
}, []);
|
||||
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -154,6 +154,7 @@ export const generateSRPClient = async (
|
||||
|
||||
resolve(srpClient);
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user