Added local storage clearing for cache clear

This commit is contained in:
Mitchell McCaffrey 2020-08-12 10:37:28 +10:00
parent b184f5798c
commit 68f5a409e2

View File

@ -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