summaryrefslogtreecommitdiff
path: root/packages/client/src
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2022-05-01 05:15:01 +0000
committertamaina <tamaina@hotmail.co.jp>2022-05-01 05:15:01 +0000
commit27b48ef96dc0f2c84e8e2c447db16f2c3511561a (patch)
tree84a4ef487942733589b2d9001712fc56eb89308b /packages/client/src
parentuse toRaw? (diff)
downloadsharkey-27b48ef96dc0f2c84e8e2c447db16f2c3511561a.tar.gz
sharkey-27b48ef96dc0f2c84e8e2c447db16f2c3511561a.tar.bz2
sharkey-27b48ef96dc0f2c84e8e2c447db16f2c3511561a.zip
ressurect deepcopy
Diffstat (limited to 'packages/client/src')
-rw-r--r--packages/client/src/pizzax.ts5
1 files changed, 3 insertions, 2 deletions
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<string, {
where: 'account' | 'device' | 'deviceAccount';
@@ -153,7 +154,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 = structuredClone(toRaw(value));
+ const rawValue = deepcopy(value);
if (_DEV_) console.log('set', key, rawValue, value);