summaryrefslogtreecommitdiff
path: root/src/client/init.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/init.ts')
-rw-r--r--src/client/init.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/init.ts b/src/client/init.ts
index 4d71ea819a..8a08267321 100644
--- a/src/client/init.ts
+++ b/src/client/init.ts
@@ -103,9 +103,13 @@ document.body.innerHTML = '<div id="app"></div>';
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();
}