ressurect deepcopy
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user