|
|
@ -24,9 +24,12 @@ class SettingsUI { |
|
|
|
|
|
|
|
|
|
|
|
this._components.registry = globalRegistry |
|
|
|
this._components.registry = globalRegistry |
|
|
|
this._deps = { |
|
|
|
this._deps = { |
|
|
|
networkModule: this._components.registry.get('network').api |
|
|
|
networkModule: this._components.registry.get('network').api, |
|
|
|
|
|
|
|
config: this._components.registry.get('config').api |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this._deps.config.events.on('settings/personal-mode_changed', this.onPersonalChange) |
|
|
|
|
|
|
|
|
|
|
|
setInterval(() => { |
|
|
|
setInterval(() => { |
|
|
|
this.updateAccountBalances() |
|
|
|
this.updateAccountBalances() |
|
|
|
}, 10 * 1000) |
|
|
|
}, 10 * 1000) |
|
|
@ -215,19 +218,25 @@ class SettingsUI { |
|
|
|
} |
|
|
|
} |
|
|
|
break |
|
|
|
break |
|
|
|
case 'web3': { |
|
|
|
case 'web3': { |
|
|
|
if (!this._components.registry.get('config').api.get('settings/personal-mode')) { |
|
|
|
onPersonalChange() |
|
|
|
plusBtn.classList.add(css.disableMouseEvents) |
|
|
|
|
|
|
|
plusTitle.title = 'Creating an account is possible only in Personal mode. Please go to Settings to enable it.' |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
plusBtn.classList.remove(css.disableMouseEvents) |
|
|
|
|
|
|
|
plusTitle.title = 'Create a new account' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
break |
|
|
|
break |
|
|
|
default: |
|
|
|
default: |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onPersonalChange() { |
|
|
|
|
|
|
|
let plusBtn = document.getElementById('remixRunPlus') |
|
|
|
|
|
|
|
let plusTitle = document.getElementById('remixRunPlusWraper') |
|
|
|
|
|
|
|
if (!this._deps.config.get('settings/personal-mode')) { |
|
|
|
|
|
|
|
plusBtn.classList.add(css.disableMouseEvents) |
|
|
|
|
|
|
|
plusTitle.title = 'Creating an account is possible only in Personal mode. Please go to Settings to enable it.' |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
plusBtn.classList.remove(css.disableMouseEvents) |
|
|
|
|
|
|
|
plusTitle.title = 'Create a new account' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
newAccount () { |
|
|
|
newAccount () { |
|
|
|
this.settings.newAccount( |
|
|
|
this.settings.newAccount( |
|
|
|
(cb) => { |
|
|
|
(cb) => { |
|
|
|