diff options
| author | tamaina <tamaina@hotmail.co.jp> | 2022-04-27 23:06:40 +0900 |
|---|---|---|
| committer | tamaina <tamaina@hotmail.co.jp> | 2022-04-27 23:06:40 +0900 |
| commit | f9bae60357ec4c67d3cf96b5d53c6eee852569cb (patch) | |
| tree | ab15fd2138ae71e2ca9efcec59029312413910cb /packages/client/src | |
| parent | Merge branch 'develop' into pizzax-indexeddb (diff) | |
| download | misskey-f9bae60357ec4c67d3cf96b5d53c6eee852569cb.tar.gz misskey-f9bae60357ec4c67d3cf96b5d53c6eee852569cb.tar.bz2 misskey-f9bae60357ec4c67d3cf96b5d53c6eee852569cb.zip | |
remove deepcopy and broadcast-channel (=< Safari 15.4)
Diffstat (limited to 'packages/client/src')
| -rw-r--r-- | packages/client/src/pizzax.ts | 5 | ||||
| -rw-r--r-- | packages/client/src/scripts/unison-reload.ts | 5 |
2 files changed, 2 insertions, 8 deletions
diff --git a/packages/client/src/pizzax.ts b/packages/client/src/pizzax.ts index 11bf4f9c48..e71f139246 100644 --- a/packages/client/src/pizzax.ts +++ b/packages/client/src/pizzax.ts @@ -4,9 +4,6 @@ import { api } from './os'; import { get, set } from './scripts/idb-proxy'; import { defaultStore } from './store'; import { stream } from './stream'; -import * as deepcopy from 'deepcopy'; -// SafariがBroadcastChannel未実装なのでライブラリを使う -import { BroadcastChannel } from 'broadcast-channel'; type StateDef = Record<string, { where: 'account' | 'device' | 'deviceAccount'; @@ -155,7 +152,7 @@ export class Storage<T extends StateDef> { public set<K extends keyof T>(key: K, value: T[K]['default']): Promise<void> { // IndexedDBやBroadcastChannelで扱うために単純なオブジェクトにする // (JSON.parse(JSON.stringify(value))の代わり) - const rawValue = deepcopy(value); + const rawValue = structuredClone(value); if (_DEV_) console.log('set', key, rawValue, value); diff --git a/packages/client/src/scripts/unison-reload.ts b/packages/client/src/scripts/unison-reload.ts index 59af584c1b..0cd7eff38d 100644 --- a/packages/client/src/scripts/unison-reload.ts +++ b/packages/client/src/scripts/unison-reload.ts @@ -1,7 +1,4 @@ -// SafariがBroadcastChannel未実装なのでライブラリを使う -import { BroadcastChannel } from 'broadcast-channel'; - -export const reloadChannel = new BroadcastChannel<string | null>('reload'); +export const reloadChannel = new BroadcastChannel('reload'); // string | null // BroadcastChannelを用いて、クライアントが一斉にreloadするようにします。 export function unisonReload(path?: string) { |