forked from FoundKeyGang/FoundKey
client: fetch meta via GET
This commit is contained in:
parent
9022ab9f2a
commit
4f9504d135
1 changed files with 2 additions and 8 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue