summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2020-07-15 18:03:08 +0900
committersyuilo <syuilotan@yahoo.co.jp>2020-07-15 18:03:08 +0900
commit9d3beb3174f87f05c50e2e7304a03d2c55a3f7ec (patch)
treeb724e462806404b86d384a4e69609319d1a485ef /src/client
parentchore: Add note (diff)
downloadsharkey-9d3beb3174f87f05c50e2e7304a03d2c55a3f7ec.tar.gz
sharkey-9d3beb3174f87f05c50e2e7304a03d2c55a3f7ec.tar.bz2
sharkey-9d3beb3174f87f05c50e2e7304a03d2c55a3f7ec.zip
fix(client): Fix #6540
Diffstat (limited to 'src/client')
-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();
}