One Calendar is a privacy-first calendar web app built with Next.js. It has modern security features, including e2ee, password-protected sharing, and self-destructing share links ๐Ÿ“… calendar.xyehr.cn
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #195 from EvanTechDev/feature/fix-unlock-section-view-bugs

fix(backup): apply restored default view and first-day settings

authored by

Evan Huang and committed by
GitHub
15b76441 3fddaa93

+9 -3
+2
components/app/profile/user-profile-button.tsx
··· 59 59 clearEncryptionPassword, 60 60 isSensitiveStorageKey, 61 61 markEncryptedSnapshot, 62 + removeInMemoryStorage, 62 63 readEncryptedLocalStorage, 63 64 setEncryptionPassword, 64 65 writeInMemoryStorage, ··· 136 137 writeInMemoryStorage(key, normalized); 137 138 markEncryptedSnapshot(key, normalized); 138 139 if (!isSensitiveStorageKey(key)) { 140 + removeInMemoryStorage(key); 139 141 localStorage.setItem(key, normalized); 140 142 } 141 143 window.dispatchEvent(
+7 -3
hooks/useLocalStorage.ts
··· 110 110 inMemoryStorage.set(key, value) 111 111 } 112 112 113 + export function removeInMemoryStorage(key: string) { 114 + inMemoryStorage.delete(key) 115 + } 116 + 113 117 export function readInMemoryStorage(key: string) { 114 118 return inMemoryStorage.get(key) ?? null 115 119 } ··· 175 179 } 176 180 try { 177 181 const inMemoryValue = inMemoryStorage.get(key) 178 - if (inMemoryValue !== undefined) { 182 + if (isSensitiveStorageKey(key) && inMemoryValue !== undefined) { 179 183 return coerceStoredValue(inMemoryValue, initialValue) 180 184 } 181 185 const snapshot = encryptedSnapshots.get(key) ··· 250 254 } 251 255 try { 252 256 const inMemoryValue = inMemoryStorage.get(key) 253 - if (inMemoryValue !== undefined) { 257 + if (isSensitiveStorageKey(key) && inMemoryValue !== undefined) { 254 258 return coerceStoredValue(inMemoryValue, initialValue) 255 259 } 256 260 const item = window.localStorage.getItem(key) ··· 381 385 }, [key, serializedValue, storedValue]) 382 386 383 387 return [storedValue, setStoredValue] as const 384 - } 388 + }