mirror of
https://github.com/urbit/shrub.git
synced 2024-12-23 02:41:35 +03:00
13 lines
365 B
TypeScript
13 lines
365 B
TypeScript
import { createStorageKey } from './state/util';
|
|
|
|
const key = createStorageKey(`storage-wipe-${import.meta.env.VITE_LAST_WIPE}`);
|
|
const wiped = localStorage.getItem(key);
|
|
|
|
// Loaded before everything, this clears local storage just once.
|
|
// Change VITE_LAST_WIPE in .env to date of wipe
|
|
|
|
if (!wiped) {
|
|
localStorage.clear();
|
|
localStorage.setItem(key, 'true');
|
|
}
|