Adding clear cache button to settings

This commit is contained in:
Fabian 2019-06-18 23:28:07 +02:00
parent 60b238d42e
commit c52e08afa9
3 changed files with 3 additions and 1 deletions

View File

@ -30,6 +30,7 @@ self.addEventListener('message', (event) => {
if (event.data === "clear_cache") {
log("Clearing cache");
caches.delete(CACHE);
event.waitUntil(precache());
}
if (event.data === "update_index") {

View File

@ -65,7 +65,7 @@ export class Footer extends Component<{}, { synced: boolean, syncing: boolean }>
Welcome <b>{Notes.name}</b>
</span>
<span style="color: lightgrey;">
v1.3
v1.4
</span>
</footer>
}

View File

@ -18,6 +18,7 @@ export default class SettingsPage extends Page<{ state: any }, { vault: string }
</header>
<div class="container">
<button class="btn" onClick={() => Theme.toggle()}>Toggle Dark Mode</button>
<button class="btn" onClick={() => window.navigator.serviceWorker.controller.postMessage("clear_cache")}>Clear cache</button>
</div>
</div >;
}