Files
ente/web/packages/base/local-storage.ts
Manav Rathi fdb4b0374c Prepare for eventual yarn => npm migration
npm doesn't support the "@" character in package names (it's used for
scopes). We eventually want to move from yarn to npm, so in preparation, rename
our internal packages accordingly so that they also work with npm workspaces.

Methodology: No manual code changes, just automatic search replace of

```
"@/accounts => "ente-accounts
"@/utils => "ente-utils
...
"@ente/shared => "ente-shared
```

Then reran prettier.
2025-04-02 18:37:16 +05:30

15 lines
403 B
TypeScript

import { nullToUndefined } from "ente-utils/transform";
/**
* Clear local storage on logout.
*
* This function clears everything from local storage except the app's logs.
*/
export const clearLocalStorage = () => {
const existingLogs = nullToUndefined(localStorage.getItem("logs"));
localStorage.clear();
if (existingLogs) {
localStorage.setItem("logs", existingLogs);
}
};