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 #224 from EvanTechDev/feature/bug

fix: prevent unintended cloud write when unlocking profile backup

authored by

Evan Huang and committed by
GitHub
8d4a8396 a0ee346e

+6
+6
components/app/profile/user-profile-button.tsx
··· 252 252 253 253 const keyRef = useRef<string | null>(null); 254 254 const restoredRef = useRef(false); 255 + const skipNextAutoBackupRef = useRef(false); 255 256 const timerRef = useRef<any>(null); 256 257 const [backupTick, setBackupTick] = useState(0); 257 258 ··· 331 332 332 333 useEffect(() => { 333 334 if (!enabled || !keyRef.current || !restoredRef.current) return; 335 + if (skipNextAutoBackupRef.current) { 336 + skipNextAutoBackupRef.current = false; 337 + return; 338 + } 334 339 if (timerRef.current) clearTimeout(timerRef.current); 335 340 336 341 timerRef.current = setTimeout(async () => { ··· 527 532 528 533 keyRef.current = password; 529 534 restoredRef.current = true; 535 + skipNextAutoBackupRef.current = true; 530 536 localStorage.setItem(AUTO_KEY, "true"); 531 537 setEnabled(true); 532 538 broadcastBackupStatus("done");