Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix

Manav Rathi261a7f278b61
diff --git a/web/packages/shared/storage/localStorage/index.ts b/web/packages/shared/storage/localStorage/index.ts
index 6330f21d9a..156f466261 100644
--- a/web/packages/shared/storage/localStorage/index.ts
+++ b/web/packages/shared/storage/localStorage/index.ts
@@ -70,11 +70,13 @@ export const setLSUser = async (user: object) => {
export const migrateKVToken = async (user: unknown) => {
// Throw an error if the data is in local storage but not in IndexedDB. This
// is a pre-cursor to inlining this code.
+ // TODO(REL): Remove this sanity check after a few days.
+ const oldLSUser = getData(LS_KEYS.USER);
const wasMissing =
- user &&
- typeof user == "object" &&
- "token" in user &&
- typeof user.token == "string" &&
+ oldLSUser &&
+ typeof oldLSUser == "object" &&
+ "token" in oldLSUser &&
+ typeof oldLSUser.token == "string" &&
!(await getKV("token"));
user &&