From 54bf2808744a552fca45bdd6a08c351147f3cff2 Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 29 Dec 2021 16:13:42 +0900 Subject: [PATCH] =?UTF-8?q?=E5=BF=85=E8=A6=81=E3=81=AA=E6=99=82=E4=BB=A5?= =?UTF-8?q?=E5=A4=96=E3=81=AF=E3=82=B9=E3=83=88=E3=83=AC=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=97=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/client/src/pizzax.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/client/src/pizzax.ts b/packages/client/src/pizzax.ts index 63abe40b0..7bfa6a2ab 100644 --- a/packages/client/src/pizzax.ts +++ b/packages/client/src/pizzax.ts @@ -80,8 +80,10 @@ export class Storage { this.reactiveState[key].value = value; const cache = JSON.parse(localStorage.getItem(this.keyForLocalStorage + '::cache::' + $i.id) || '{}'); - cache[key] = value; - localStorage.setItem(this.keyForLocalStorage + '::cache::' + $i.id, JSON.stringify(cache)); + if (cache[key] !== value) { + cache[key] = value; + localStorage.setItem(this.keyForLocalStorage + '::cache::' + $i.id, JSON.stringify(cache)); + } }); } }