• R/O
  • HTTP
  • SSH
  • HTTPS

Byone: Commit

Bytom Wallet for Chrome


Commit MetaInfo

Revision5c6ac28fcb95a0e2a18ddf6f1af7c29f7726b9f0 (tree)
Time2020-10-13 12:04:46
AuthorZhiting Lin <zlin035@uott...>
CommiterZhiting Lin

Log Message

update the sync storage for multiple store.

Change Summary

Incremental Difference

--- a/src/popup.js
+++ b/src/popup.js
@@ -34,6 +34,7 @@ import _ from 'lodash'
3434 import * as Sentry from "@sentry/browser";
3535 import { Vue as VueIntegration } from "@sentry/integrations";
3636 import { Integrations } from '@sentry/tracing';
37+import BytomObj from "./utils/Bytom";
3738
3839 store.dispatch(Actions.LOAD_BYTOM).then(() => {
3940 Vue.use(VueI18n)
@@ -88,6 +89,14 @@ store.dispatch(Actions.LOAD_BYTOM).then(() => {
8889
8990 account.setupNet(`${store.getters.net}${store.getters.netType}`)
9091
92+ apis.storage.onChanged.addListener(function(changes, namespace) {
93+ for (let key in changes) {
94+ if(key === 'bytom'){
95+ store.dispatch(Actions.LOAD_BYTOM)
96+ }
97+ }
98+ });
99+
91100 store.watch(
92101 (state, getters) => getters.netType,
93102 (newValue, oldValue) => {
--- a/src/prompt.js
+++ b/src/prompt.js
@@ -32,6 +32,7 @@ import _ from 'lodash'
3232 import * as Sentry from "@sentry/browser";
3333 import { Vue as VueIntegration } from "@sentry/integrations";
3434 import { Integrations } from '@sentry/tracing';
35+import BytomObj from "./utils/Bytom";
3536
3637 store.dispatch(Actions.LOAD_BYTOM).then(() => {
3738 Vue.use(VueI18n)
@@ -71,6 +72,14 @@ store.dispatch(Actions.LOAD_BYTOM).then(() => {
7172 }
7273 }
7374
75+ apis.storage.onChanged.addListener(function(changes, namespace) {
76+ for (let key in changes) {
77+ if(key === 'bytom'){
78+ store.dispatch(Actions.LOAD_BYTOM)
79+ }
80+ }
81+ });
82+
7483 Sentry.init({
7584 dsn: "https://f080e90fe9d94cf9b05323b373d839f3@o441881.ingest.sentry.io/5412722",
7685 release: "byone@" + process.env.npm_package_version,
Show on old repository browser