From 9d3beb3174f87f05c50e2e7304a03d2c55a3f7ec Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 15 Jul 2020 18:03:08 +0900 Subject: [PATCH] fix(client): Fix #6540 --- src/client/init.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/init.ts b/src/client/init.ts index 4d71ea819..8a0826732 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -103,9 +103,13 @@ document.body.innerHTML = '
'; const store = createStore(); +// 他のタブと永続化されたstateを同期 window.addEventListener('storage', e => { if (e.key === 'vuex') { - store.replaceState(JSON.parse(localStorage['vuex'])); + store.replaceState({ + ...store.state, + ...JSON.parse(e.newValue) + }); } else if (e.key === 'i') { location.reload(); }