From 235df532efdcefdc5fb41d0cee855e1ffc5ce4c2 Mon Sep 17 00:00:00 2001 From: mattyatea Date: Mon, 25 Sep 2023 02:07:30 +0900 Subject: [PATCH] =?UTF-8?q?navbar=E3=81=AB=E3=82=AD=E3=83=A3=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A5=E3=82=AF=E3=83=AA=E3=82=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/navbar.ts | 14 ++++++++++++++ packages/frontend/src/store.ts | 1 + 2 files changed, 15 insertions(+) diff --git a/packages/frontend/src/navbar.ts b/packages/frontend/src/navbar.ts index 7f182a98f7..36d1a3187d 100644 --- a/packages/frontend/src/navbar.ts +++ b/packages/frontend/src/navbar.ts @@ -12,6 +12,7 @@ import * as os from '@/os.js'; import { i18n } from '@/i18n.js'; import { ui } from '@/config.js'; import { unisonReload } from '@/scripts/unison-reload.js'; +import {fetchCustomEmojis} from "@/custom-emojis.js"; export const navbarItemDef = reactive({ notifications: { @@ -155,4 +156,17 @@ export const navbarItemDef = reactive({ show: computed(() => $i != null), to: `/@${$i?.username}`, }, + cacheclear: { + icon: 'ti ti-trash', + title: i18n.ts.clearCache, + action: async () => { + os.waiting(); + miLocalStorage.removeItem('locale'); + miLocalStorage.removeItem('theme'); + miLocalStorage.removeItem('emojis'); + miLocalStorage.removeItem('lastEmojisFetchedAt'); + await fetchCustomEmojis(true); + unisonReload(); + } + }, }); diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index e74116e041..18aef358bd 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -133,6 +133,7 @@ export const defaultStore = markRaw(new Storage('base', { 'search', '-', 'ui', + 'cacheclear', ], }, visibility: {