2024-03-13 14:37:18 +01:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-11-30 06:48:02 +01:00
|
|
|
import { unisonReload } from '@/scripts/unison-reload.js';
|
|
|
|
import * as os from '@/os.js';
|
|
|
|
import { miLocalStorage } from '@/local-storage.js';
|
|
|
|
import { fetchCustomEmojis } from '@/custom-emojis.js';
|
2024-02-23 02:47:17 +01:00
|
|
|
import { fetchInstance } from '@/instance.js';
|
2023-11-30 06:48:02 +01:00
|
|
|
|
|
|
|
export async function clearCache() {
|
|
|
|
os.waiting();
|
2024-02-23 02:47:17 +01:00
|
|
|
miLocalStorage.removeItem('instance');
|
|
|
|
miLocalStorage.removeItem('instanceCachedAt');
|
2023-11-30 06:48:02 +01:00
|
|
|
miLocalStorage.removeItem('locale');
|
2023-12-14 12:21:57 +01:00
|
|
|
miLocalStorage.removeItem('localeVersion');
|
2023-11-30 06:48:02 +01:00
|
|
|
miLocalStorage.removeItem('theme');
|
|
|
|
miLocalStorage.removeItem('emojis');
|
|
|
|
miLocalStorage.removeItem('lastEmojisFetchedAt');
|
2024-02-23 02:47:17 +01:00
|
|
|
await fetchInstance(true);
|
2023-11-30 06:48:02 +01:00
|
|
|
await fetchCustomEmojis(true);
|
|
|
|
unisonReload();
|
|
|
|
}
|