From 68f5a409e2f5e6cfed565184ce7c60dfe9beae4b Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Wed, 12 Aug 2020 10:37:28 +1000 Subject: [PATCH] Added local storage clearing for cache clear --- src/modals/SettingsModal.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modals/SettingsModal.js b/src/modals/SettingsModal.js index 61a75ee..0a9316b 100644 --- a/src/modals/SettingsModal.js +++ b/src/modals/SettingsModal.js @@ -12,11 +12,15 @@ function SettingsModal({ isOpen, onRequestClose }) { const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false); async function handleEraseAllData() { + localStorage.clear(); await database.delete(); window.location.reload(); } async function handleClearCache() { + // Clear saved settings + localStorage.clear(); + // Clear map cache await database.table("maps").where("owner").notEqual(userId).delete(); // Find all other peoples tokens who aren't benig used in a map state and delete them const tokens = await database