localeとthemeのキャッシュクリア実装

This commit is contained in:
syuilo 2020-12-30 10:15:16 +09:00
parent 2c93246860
commit 3055e6d8c7
3 changed files with 10 additions and 5 deletions

View file

@ -27,6 +27,9 @@
<FormLink :active="page === 'api'" replace to="/settings/api"><template #icon><Fa :icon="faKey"/></template>API</FormLink>
<FormLink :active="page === 'other'" replace to="/settings/other"><template #icon><Fa :icon="faEllipsisH"/></template>{{ $ts.other }}</FormLink>
</FormGroup>
<FormGroup>
<FormButton @click="clear">{{ $ts.clearCache }}</FormButton>
</FormGroup>
<FormGroup>
<FormButton @click="logout" danger>{{ $ts.logout }}</FormButton>
</FormGroup>
@ -126,6 +129,11 @@ export default defineComponent({
logout: () => {
signout();
},
clear: () => {
localStorage.removeItem('locale');
localStorage.removeItem('theme');
location.reload();
},
faPalette, faPlug, faUser, faListUl, faLock, faLaugh, faCommentSlash, faMusic, faBell, faCogs, faEllipsisH, faBan, faShareAlt, faLockOpen, faKey, faBoxes, faEnvelope,
};
},