mirror of
https://github.com/LifeArchiveProject/WeChatDataAnalysis.git
synced 2026-06-18 15:54:08 +08:00
a79ff81be0
- Move frontend/utils/ to frontend/lib/ to avoid Nuxt unimport scanner incorrectly extracting function parameter names (value, fallback) as module-level exports, which injected phantom imports that broke all client-side JavaScript execution - Update all import paths across 13 files from ~/utils/ to ~/lib/ - Add timeout (5s) and negative cache (60s TTL) to WCDB realtime ensure_connected() to prevent open_account() from hanging indefinitely when the WeChat database is locked - Reorder selectContact() to fire loadMessages() before navigateTo() so the message fetch starts before route navigation triggers Suspense - Add watch: false to SSR useAsyncData calls to prevent unnecessary re-fetching on client-side route changes
21 lines
565 B
JavaScript
21 lines
565 B
JavaScript
export const PRIVACY_MODE_KEY = 'ui.privacy_mode'
|
|
|
|
export const readPrivacyMode = (fallback = false) => {
|
|
if (!process.client) return !!fallback
|
|
try {
|
|
const raw = localStorage.getItem(PRIVACY_MODE_KEY)
|
|
if (raw == null) return !!fallback
|
|
const normalized = String(raw).trim().toLowerCase()
|
|
return normalized === '1' || normalized === 'true'
|
|
} catch {
|
|
return !!fallback
|
|
}
|
|
}
|
|
|
|
export const writePrivacyMode = (enabled) => {
|
|
if (!process.client) return
|
|
try {
|
|
localStorage.setItem(PRIVACY_MODE_KEY, enabled ? '1' : '0')
|
|
} catch {}
|
|
}
|