Skip to content

Commit

Permalink
Merge pull request #683 from pqv199x/webpack
Browse files Browse the repository at this point in the history
change config storage name
  • Loading branch information
pqv199x authored Jul 23, 2019
2 parents 90d755e + 5bf3c4c commit 052e78c
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Vue.prototype.setupProvider = async function (provider, wjs) {
Vue.prototype.NetworkProvider = provider
if (wjs instanceof Web3) {
const config = await getConfig()
localStorage.set('config', config)
localStorage.set('configMaster', config)
Vue.prototype.web3 = wjs
Vue.prototype.TomoValidator = new wjs.eth.Contract(
TomoValidatorArtifacts.abi,
Expand Down Expand Up @@ -381,7 +381,7 @@ getConfig().then((config) => {
// let provider = 'tomowallet'
// var web3js = new Web3(new Web3.providers.HttpProvider(config.blockchain.rpc))
// Vue.prototype.setupProvider(provider, web3js)
localStorage.set('config', config)
localStorage.set('configMaster', config)
Vue.use(VueAnalytics, {
id: config.GA,
linkers: ['tomochain.com'],
Expand All @@ -405,7 +405,7 @@ const store = new Vuex.Store({
Vue.prototype.detectNetwork = async function (provider) {
try {
let wjs = this.web3
const config = localStorage.get('config') || await getConfig()
const config = localStorage.get('configMaster') || await getConfig()
const chainConfig = config.blockchain
if (!wjs) {
switch (provider) {
Expand Down Expand Up @@ -462,7 +462,7 @@ Vue.prototype.signTransaction = async function (txParams) {
const provider = Vue.prototype.NetworkProvider
let signature
if (provider === 'ledger') {
const config = localStorage.get('config') || await getConfig()
const config = localStorage.get('configMaster') || await getConfig()
const chainConfig = config.blockchain
const rawTx = new Transaction(txParams)
rawTx.v = Buffer.from([chainConfig.networkId])
Expand Down
2 changes: 1 addition & 1 deletion app/components/Setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export default {
this.provider = this.NetworkProvider || 'tomowallet'
let self = this
self.hdWallets = self.hdWallets || {}
self.config = store.get('config') || await self.appConfig()
self.config = store.get('configMaster') || await self.appConfig()
self.chainConfig = self.config.blockchain || {}
self.networks.rpc = self.chainConfig.rpc
Expand Down
2 changes: 1 addition & 1 deletion app/components/candidates/Apply.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export default {
created: async function () {
const self = this
let account
self.config = store.get('config') || await self.appConfig()
self.config = store.get('configMaster') || await self.appConfig()
self.chainConfig = self.config.blockchain || {}
try {
self.isReady = !!self.web3
Expand Down
2 changes: 1 addition & 1 deletion app/components/candidates/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export default {
let self = this
let account
self.isReady = !!self.web3
const config = store.get('config') || await self.appConfig()
const config = store.get('configMaster') || await self.appConfig()
self.chainConfig = config.blockchain
self.currentBlock = self.chainConfig.blockNumber
Expand Down
2 changes: 1 addition & 1 deletion app/components/candidates/Resign.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default {
created: async function () {
let self = this
let account
self.config = store.get('config') || await self.appConfig()
self.config = store.get('configMaster') || await self.appConfig()
self.chainConfig = self.config.blockchain || {}
self.isReady = !!self.web3
self.gasPrice = await self.web3.eth.getGasPrice()
Expand Down
2 changes: 1 addition & 1 deletion app/components/candidates/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ export default {
},
created: async function () {
let self = this
self.config = store.get('config') || await this.appConfig()
self.config = store.get('configMaster') || await this.appConfig()
self.currentBlock = self.config.blockchain.blockNumber
self.isReady = !!self.web3
try {
Expand Down
2 changes: 1 addition & 1 deletion app/components/candidates/Withdraw.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default {
},
async mounted () {
const self = this
self.config = store.get('config') || await self.appConfig()
self.config = store.get('configMaster') || await self.appConfig()
self.chainConfig = self.config.blockchain || {}
self.isReady = !!this.web3
if (!self.coinbase) {
Expand Down
2 changes: 1 addition & 1 deletion app/components/voters/Confirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default {
updated () {},
created: async function () {
let self = this
self.config = store.get('config') || await self.appConfig()
self.config = store.get('configMaster') || await self.appConfig()
axios.get(`/api/transactions/${self.tx}`).then(function (response) {
if (response.data == null) {
Expand Down
2 changes: 1 addition & 1 deletion app/components/voters/Unvoting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export default {
let candidate = self.candidate
let account
self.loadingPage = true
self.config = store.get('config') || await self.appConfig()
self.config = store.get('configMaster') || await self.appConfig()
self.chainConfig = self.config.blockchain || {}
self.gasPrice = await self.web3.eth.getGasPrice()
self.txFee = new BigNumber(this.chainConfig.gas * self.gasPrice).div(10 ** 18).toString(10)
Expand Down
2 changes: 1 addition & 1 deletion app/components/voters/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export default {
update () {},
created: async function () {
let self = this
self.config = store.get('config') || await self.appConfig()
self.config = store.get('configMaster') || await self.appConfig()
self.getCandidates()
self.getRewards()
Expand Down
2 changes: 1 addition & 1 deletion app/components/voters/Voting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export default {
created: async function () {
let self = this
let account
self.config = store.get('config') || await self.appConfig()
self.config = store.get('configMaster') || await self.appConfig()
self.chainConfig = self.config.blockchain || {}
self.isReady = !!self.web3
self.gasPrice = await self.web3.eth.getGasPrice()
Expand Down

0 comments on commit 052e78c

Please sign in to comment.