mirror of
https://github.com/ente-io/ente.git
synced 2025-05-24 03:59:22 +00:00
15 lines
400 B
TypeScript
15 lines
400 B
TypeScript
import { nullToUndefined } from "@/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);
|
|
}
|
|
};
|