client: fetch meta via GET

This commit is contained in:
Johann150 2022-10-10 17:36:50 +02:00
parent 9022ab9f2a
commit 4f9504d135
Signed by: Johann150
GPG Key ID: 9EE6577A2A06F8F1
1 changed files with 2 additions and 8 deletions

View File

@ -1,6 +1,6 @@
import { computed, reactive } from 'vue';
import * as foundkey from 'foundkey-js';
import { api } from '@/os';
import { apiGet } from '@/os';
// TODO: 他のタブと永続化されたstateを同期
@ -13,13 +13,7 @@ export const instance: foundkey.entities.InstanceMetadata = reactive(instanceDat
});
export async function fetchInstance(): Promise<void> {
const meta = await api('meta', {
detail: false,
});
for (const [k, v] of Object.entries(meta)) {
instance[k] = v;
}
Object.assign(instance, await apiGet('meta'));
localStorage.setItem('instance', JSON.stringify(instance));
}