mirror of
https://github.com/ente-io/ente.git
synced 2025-08-09 07:48:52 +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();
|
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);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user