From 747acd025d69c44d7e7d3db117ad4ba084f3f000 Mon Sep 17 00:00:00 2001 From: tamaina Date: Thu, 28 Apr 2022 03:47:26 +0000 Subject: [PATCH] use toRaw? --- packages/client/src/pages/settings/preferences-registry.vue | 2 +- packages/client/src/pizzax.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/src/pages/settings/preferences-registry.vue b/packages/client/src/pages/settings/preferences-registry.vue index 916bb3049..c01e4ee83 100644 --- a/packages/client/src/pages/settings/preferences-registry.vue +++ b/packages/client/src/pages/settings/preferences-registry.vue @@ -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', diff --git a/packages/client/src/pizzax.ts b/packages/client/src/pizzax.ts index 5de866ef6..338898005 100644 --- a/packages/client/src/pizzax.ts +++ b/packages/client/src/pizzax.ts @@ -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 { public set(key: K, value: T[K]['default']): Promise { // IndexedDBやBroadcastChannelで扱うために単純なオブジェクトにする // (JSON.parse(JSON.stringify(value))の代わり) - const rawValue = structuredClone(value); + const rawValue = structuredClone(toRaw(value)); if (_DEV_) console.log('set', key, rawValue, value);