summaryrefslogtreecommitdiff
path: root/packages/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/client/src')
-rw-r--r--packages/client/src/pizzax.ts5
-rw-r--r--packages/client/src/scripts/unison-reload.ts5
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) {