From 27b48ef96dc0f2c84e8e2c447db16f2c3511561a Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 1 May 2022 05:15:01 +0000 Subject: ressurect deepcopy --- packages/client/src/pizzax.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/client/src') diff --git a/packages/client/src/pizzax.ts b/packages/client/src/pizzax.ts index 338898005a..389554247e 100644 --- a/packages/client/src/pizzax.ts +++ b/packages/client/src/pizzax.ts @@ -1,10 +1,11 @@ -import { onUnmounted, Ref, ref, toRaw, watch } from 'vue'; +import { onUnmounted, Ref, ref, watch } from 'vue'; import { $i } from './account'; import { api } from './os'; import { get, set } from './scripts/idb-proxy'; import { defaultStore } from './store'; import { stream } from './stream'; import { BroadcastChannel } from 'broadcast-channel'; +import deepcopy from 'deepcopy'; type StateDef = Record { public set(key: K, value: T[K]['default']): Promise { // IndexedDBやBroadcastChannelで扱うために単純なオブジェクトにする // (JSON.parse(JSON.stringify(value))の代わり) - const rawValue = structuredClone(toRaw(value)); + const rawValue = deepcopy(value); if (_DEV_) console.log('set', key, rawValue, value); -- cgit v1.2.3-freya