use toRaw?

This commit is contained in:
tamaina 2022-04-28 03:47:26 +00:00
parent b3ccfa8671
commit 747acd025d
2 changed files with 3 additions and 3 deletions

View file

@ -187,7 +187,7 @@ function loadFile() {
async function applyRegistry(id: string) {
if (!registries) return;
const registry = structuredClone(registries[id]);
const registry = registries[id];
const { canceled: cancel1 } = await os.confirm({
type: 'warning',

View file

@ -1,4 +1,4 @@
import { onUnmounted, Ref, ref, watch } from 'vue';
import { onUnmounted, Ref, ref, toRaw, watch } from 'vue';
import { $i } from './account';
import { api } from './os';
import { get, set } from './scripts/idb-proxy';
@ -153,7 +153,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(value);
const rawValue = structuredClone(toRaw(value));
if (_DEV_) console.log('set', key, rawValue, value);