diff --git a/packages/app/src/utils/deleteInternalStorage/index.js b/packages/app/src/utils/deleteInternalStorage/index.js new file mode 100644 index 00000000..51f4c4f6 --- /dev/null +++ b/packages/app/src/utils/deleteInternalStorage/index.js @@ -0,0 +1,15 @@ +import cookies from "js-cookie" + +export default () => { + window.localStorage.clear() + window.sessionStorage.clear() + + // delete all cookies + const allCookies = cookies.get() + + for (const cookieName in allCookies) { + cookies.remove(cookieName) + } + + location.reload() +} \ No newline at end of file diff --git a/packages/app/src/utils/index.js b/packages/app/src/utils/index.js index 9516229b..1d545630 100755 --- a/packages/app/src/utils/index.js +++ b/packages/app/src/utils/index.js @@ -3,4 +3,5 @@ export { default as findChildById } from "./findChildById" export { default as cursorPosition } from "./cursorPosition" export { default as getBase64 } from "./getBase64" export { default as Haptics } from "./haptics" -export { default as processString } from "./processString" \ No newline at end of file +export { default as processString } from "./processString" +export { default as deleteInternalStorage } from "./deleteInternalStorage" \ No newline at end of file