Merge branch 'notification-read-api' into swn

This commit is contained in:
tamaina 2022-03-04 15:54:03 +09:00
commit 30915d587a
912 changed files with 6686 additions and 4904 deletions

View file

@ -15,6 +15,7 @@ if (localStorage.getItem('accounts') != null) {
import { computed, createApp, watch, markRaw, version as vueVersion } from 'vue';
import compareVersions from 'compare-versions';
import * as JSON5 from 'json5';
import widgets from '@/widgets';
import directives from '@/directives';
@ -158,7 +159,9 @@ if ($i && $i.token) {
}
//#endregion
fetchInstance().then(() => {
const fetchInstanceMetaPromise = fetchInstance();
fetchInstanceMetaPromise.then(() => {
localStorage.setItem('v', instance.version);
// Init service worker
@ -266,6 +269,14 @@ window.matchMedia('(prefers-color-scheme: dark)').addListener(mql => {
});
//#endregion
fetchInstanceMetaPromise.then(() => {
if (defaultStore.state.themeInitial) {
if (instance.defaultLightTheme != null) ColdDeviceStorage.set('lightTheme', JSON5.parse(instance.defaultLightTheme));
if (instance.defaultDarkTheme != null) ColdDeviceStorage.set('darkTheme', JSON5.parse(instance.defaultDarkTheme));
defaultStore.set('themeInitial', false);
}
});
// shortcut
document.addEventListener('keydown', makeHotkey({
'd': () => {