Adding clear cache button to settings
This commit is contained in:
parent
60b238d42e
commit
c52e08afa9
@ -30,6 +30,7 @@ self.addEventListener('message', (event) => {
|
|||||||
if (event.data === "clear_cache") {
|
if (event.data === "clear_cache") {
|
||||||
log("Clearing cache");
|
log("Clearing cache");
|
||||||
caches.delete(CACHE);
|
caches.delete(CACHE);
|
||||||
|
event.waitUntil(precache());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.data === "update_index") {
|
if (event.data === "update_index") {
|
||||||
|
@ -65,7 +65,7 @@ export class Footer extends Component<{}, { synced: boolean, syncing: boolean }>
|
|||||||
Welcome <b>{Notes.name}</b>
|
Welcome <b>{Notes.name}</b>
|
||||||
</span>
|
</span>
|
||||||
<span style="color: lightgrey;">
|
<span style="color: lightgrey;">
|
||||||
v1.3
|
v1.4
|
||||||
</span>
|
</span>
|
||||||
</footer>
|
</footer>
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ export default class SettingsPage extends Page<{ state: any }, { vault: string }
|
|||||||
</header>
|
</header>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<button class="btn" onClick={() => Theme.toggle()}>Toggle Dark Mode</button>
|
<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>
|
||||||
</div >;
|
</div >;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user