refactor(frontend): os.tsに引き込んだscripts/api.tsの再exportをやめる (#12694)

* refactor(frontend): os.tsに引き込んだscripts/api.tsの再exportをやめる

* fix

* fix

* renate to "misskeyApi"

* rename file
This commit is contained in:
おさむのひと
2024-01-04 18:32:46 +09:00
committed by GitHub
parent ea41cc6ec0
commit fa9c4a19b9
191 changed files with 581 additions and 468 deletions

View File

@@ -8,7 +8,7 @@
import { onUnmounted, Ref, ref, watch } from 'vue';
import { BroadcastChannel } from 'broadcast-channel';
import { $i } from '@/account.js';
import { api } from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { get, set } from '@/scripts/idb-proxy.js';
import { defaultStore } from '@/store.js';
import { useStream } from '@/stream.js';
@@ -134,7 +134,7 @@ export class Storage<T extends StateDef> {
window.setTimeout(async () => {
await defaultStore.ready;
api('i/registry/get-all', { scope: ['client', this.key] })
misskeyApi('i/registry/get-all', { scope: ['client', this.key] })
.then(kvs => {
const cache: Partial<T> = {};
for (const [k, v] of Object.entries(this.def) as [keyof T, T[keyof T]['default']][]) {
@@ -199,7 +199,7 @@ export class Storage<T extends StateDef> {
const cache = await get(this.registryCacheKeyName) || {};
cache[key] = rawValue;
await set(this.registryCacheKeyName, cache);
await api('i/registry/set', {
await misskeyApi('i/registry/set', {
scope: ['client', this.key],
key: key.toString(),
value: rawValue,