mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-01 23:10:40 +01:00
parent
a626c69547
commit
645dbebd86
15 changed files with 29 additions and 34 deletions
|
@ -29,7 +29,7 @@ import { stream } from '@/stream';
|
|||
import * as sound from '@/scripts/sound';
|
||||
import { $i, refreshAccount, login, updateAccount, signout } from '@/account';
|
||||
import { defaultStore, ColdDeviceStorage } from '@/store';
|
||||
import { instance, instanceMetaReady } from '@/instance';
|
||||
import { fetchInstance, instance } from '@/instance';
|
||||
import { makeHotkey } from '@/scripts/hotkey';
|
||||
import { search } from '@/scripts/search';
|
||||
import { deviceKind } from '@/scripts/device-kind';
|
||||
|
@ -159,7 +159,7 @@ if ($i && $i.token) {
|
|||
}
|
||||
//#endregion
|
||||
|
||||
instanceMetaReady.then(() => {
|
||||
fetchInstance().then(() => {
|
||||
localStorage.setItem('v', instance.version);
|
||||
|
||||
// Init service worker
|
||||
|
|
|
@ -8,11 +8,11 @@ const data = localStorage.getItem('instance');
|
|||
|
||||
// TODO: instanceをリアクティブにするかは再考の余地あり
|
||||
|
||||
export const instance: Misskey.entities.InstanceMetadata = reactive(data != null ? JSON.parse(data) : {
|
||||
export const instance: Misskey.entities.InstanceMetadata = reactive(data ? JSON.parse(data) : {
|
||||
// TODO: set default values
|
||||
});
|
||||
|
||||
async function fetchInstance() {
|
||||
export async function fetchInstance() {
|
||||
const meta = await api('meta', {
|
||||
detail: false
|
||||
});
|
||||
|
@ -24,11 +24,6 @@ async function fetchInstance() {
|
|||
localStorage.setItem('instance', JSON.stringify(instance));
|
||||
}
|
||||
|
||||
const initialFetchPromise = fetchInstance();
|
||||
export const instanceMetaReady = data != null ? Promise.resolve() : initialFetchPromise;
|
||||
|
||||
export const refetchInstanceMeta = fetchInstance;
|
||||
|
||||
export const emojiCategories = computed(() => {
|
||||
if (instance.emojis == null) return [];
|
||||
const categories = new Set();
|
||||
|
|
|
@ -52,7 +52,7 @@ import FormSuspense from '@/components/form/suspense.vue';
|
|||
import FormSlot from '@/components/form/slot.vue';
|
||||
import * as os from '@/os';
|
||||
import * as symbols from '@/symbols';
|
||||
import { refetchInstanceMeta } from '@/instance';
|
||||
import { fetchInstance } from '@/instance';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
@ -109,7 +109,7 @@ export default defineComponent({
|
|||
recaptchaSiteKey: this.recaptchaSiteKey,
|
||||
recaptchaSecretKey: this.recaptchaSecretKey,
|
||||
}).then(() => {
|
||||
refetchInstanceMeta();
|
||||
fetchInstance();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ import FormSplit from '@/components/form/split.vue';
|
|||
import FormSection from '@/components/form/section.vue';
|
||||
import * as os from '@/os';
|
||||
import * as symbols from '@/symbols';
|
||||
import { refetchInstanceMeta } from '@/instance';
|
||||
import { fetchInstance } from '@/instance';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
@ -129,7 +129,7 @@ export default defineComponent({
|
|||
smtpUser: this.smtpUser,
|
||||
smtpPass: this.smtpPass,
|
||||
}).then(() => {
|
||||
refetchInstanceMeta();
|
||||
fetchInstance();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import FormTextarea from '@/components/form/textarea.vue';
|
|||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os';
|
||||
import * as symbols from '@/symbols';
|
||||
import { refetchInstanceMeta } from '@/instance';
|
||||
import { fetchInstance } from '@/instance';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
@ -50,7 +50,7 @@ export default defineComponent({
|
|||
os.apiWithDialog('admin/update-meta', {
|
||||
blockedHosts: this.blockedHosts.split('\n') || [],
|
||||
}).then(() => {
|
||||
refetchInstanceMeta();
|
||||
fetchInstance();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ import FormInfo from '@/components/ui/info.vue';
|
|||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os';
|
||||
import * as symbols from '@/symbols';
|
||||
import { refetchInstanceMeta } from '@/instance';
|
||||
import { fetchInstance } from '@/instance';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
@ -72,7 +72,7 @@ export default defineComponent({
|
|||
discordClientId: this.discordClientId,
|
||||
discordClientSecret: this.discordClientSecret,
|
||||
}).then(() => {
|
||||
refetchInstanceMeta();
|
||||
fetchInstance();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ import FormInfo from '@/components/ui/info.vue';
|
|||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os';
|
||||
import * as symbols from '@/symbols';
|
||||
import { refetchInstanceMeta } from '@/instance';
|
||||
import { fetchInstance } from '@/instance';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
@ -72,7 +72,7 @@ export default defineComponent({
|
|||
githubClientId: this.githubClientId,
|
||||
githubClientSecret: this.githubClientSecret,
|
||||
}).then(() => {
|
||||
refetchInstanceMeta();
|
||||
fetchInstance();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ import FormInfo from '@/components/ui/info.vue';
|
|||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os';
|
||||
import * as symbols from '@/symbols';
|
||||
import { refetchInstanceMeta } from '@/instance';
|
||||
import { fetchInstance } from '@/instance';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
@ -72,7 +72,7 @@ export default defineComponent({
|
|||
twitterConsumerKey: this.twitterConsumerKey,
|
||||
twitterConsumerSecret: this.twitterConsumerSecret,
|
||||
}).then(() => {
|
||||
refetchInstanceMeta();
|
||||
fetchInstance();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ import XGithub from './integrations.github.vue';
|
|||
import XDiscord from './integrations.discord.vue';
|
||||
import * as os from '@/os';
|
||||
import * as symbols from '@/symbols';
|
||||
import { refetchInstanceMeta } from '@/instance';
|
||||
import { fetchInstance } from '@/instance';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
|
|
@ -75,7 +75,7 @@ import FormSplit from '@/components/form/split.vue';
|
|||
import FormSection from '@/components/form/section.vue';
|
||||
import * as os from '@/os';
|
||||
import * as symbols from '@/symbols';
|
||||
import { refetchInstanceMeta } from '@/instance';
|
||||
import { fetchInstance } from '@/instance';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
@ -151,7 +151,7 @@ export default defineComponent({
|
|||
objectStorageSetPublicRead: this.objectStorageSetPublicRead,
|
||||
objectStorageS3ForcePathStyle: this.objectStorageS3ForcePathStyle,
|
||||
}).then(() => {
|
||||
refetchInstanceMeta();
|
||||
fetchInstance();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import FormSection from '@/components/form/section.vue';
|
|||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os';
|
||||
import * as symbols from '@/symbols';
|
||||
import { refetchInstanceMeta } from '@/instance';
|
||||
import { fetchInstance } from '@/instance';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
@ -49,7 +49,7 @@ export default defineComponent({
|
|||
save() {
|
||||
os.apiWithDialog('admin/update-meta', {
|
||||
}).then(() => {
|
||||
refetchInstanceMeta();
|
||||
fetchInstance();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import MkInfo from '@/components/ui/info.vue';
|
|||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os';
|
||||
import * as symbols from '@/symbols';
|
||||
import { refetchInstanceMeta } from '@/instance';
|
||||
import { fetchInstance } from '@/instance';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
@ -65,7 +65,7 @@ export default defineComponent({
|
|||
os.apiWithDialog('admin/update-meta', {
|
||||
proxyAccountId: this.proxyAccountId,
|
||||
}).then(() => {
|
||||
refetchInstanceMeta();
|
||||
fetchInstance();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ import FormButton from '@/components/ui/button.vue';
|
|||
import XBotProtection from './bot-protection.vue';
|
||||
import * as os from '@/os';
|
||||
import * as symbols from '@/symbols';
|
||||
import { refetchInstanceMeta } from '@/instance';
|
||||
import { fetchInstance } from '@/instance';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
@ -82,7 +82,7 @@ export default defineComponent({
|
|||
os.apiWithDialog('admin/update-meta', {
|
||||
summalyProxy: this.summalyProxy,
|
||||
}).then(() => {
|
||||
refetchInstanceMeta();
|
||||
fetchInstance();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ import FormSplit from '@/components/form/split.vue';
|
|||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os';
|
||||
import * as symbols from '@/symbols';
|
||||
import { refetchInstanceMeta } from '@/instance';
|
||||
import { fetchInstance } from '@/instance';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
@ -244,7 +244,7 @@ export default defineComponent({
|
|||
deeplAuthKey: this.deeplAuthKey,
|
||||
deeplIsPro: this.deeplIsPro,
|
||||
}).then(() => {
|
||||
refetchInstanceMeta();
|
||||
fetchInstance();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,8 +123,8 @@ export default defineComponent({
|
|||
|
||||
const installedThemes = ref(getThemes());
|
||||
const themes = computed(() => builtinThemes.concat(installedThemes.value));
|
||||
const darkThemes = computed(() => themes.value.filter(t => t.base === 'dark' || t.kind === 'dark'));
|
||||
const lightThemes = computed(() => themes.value.filter(t => t.base === 'light' || t.kind === 'light'));
|
||||
const darkThemes = computed(() => themes.value.filter(t => t.base == 'dark' || t.kind == 'dark'));
|
||||
const lightThemes = computed(() => themes.value.filter(t => t.base == 'light' || t.kind == 'light'));
|
||||
const darkTheme = ColdDeviceStorage.ref('darkTheme');
|
||||
const darkThemeId = computed({
|
||||
get() {
|
||||
|
|
Loading…
Reference in a new issue