mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 22:59:11 +03:00
* Smol tweak to consent toast on mobile * Use useConsent hook from packages in dashboard, and remove manual calling of ConsentToast + deprecate dashboard's copy of telemetry local storage key * Attempt to fix playwright tests * Fix
24 lines
708 B
TypeScript
24 lines
708 B
TypeScript
import { LOCAL_STORAGE_KEYS } from 'lib/constants'
|
|
import { LOCAL_STORAGE_KEYS as COMMON_LOCAL_STORAGE_KEYS } from 'common'
|
|
|
|
const LOCAL_STORAGE_KEYS_ALLOWLIST = [
|
|
'graphiql:theme',
|
|
'theme',
|
|
'supabaseDarkMode',
|
|
'supabase.dashboard.auth.debug',
|
|
'supabase.dashboard.auth.navigatorLock.disabled',
|
|
COMMON_LOCAL_STORAGE_KEYS.TELEMETRY_CONSENT,
|
|
LOCAL_STORAGE_KEYS.UI_PREVIEW_API_SIDE_PANEL,
|
|
LOCAL_STORAGE_KEYS.UI_PREVIEW_NAVIGATION_LAYOUT,
|
|
LOCAL_STORAGE_KEYS.UI_PREVIEW_CLS,
|
|
LOCAL_STORAGE_KEYS.LAST_SIGN_IN_METHOD,
|
|
]
|
|
|
|
export function clearLocalStorage() {
|
|
for (const key in localStorage) {
|
|
if (!LOCAL_STORAGE_KEYS_ALLOWLIST.includes(key)) {
|
|
localStorage.removeItem(key)
|
|
}
|
|
}
|
|
}
|