diff --git a/src/components/account-select.vue b/src/components/account-select.vue index 770dc2ff..805ee45a 100644 --- a/src/components/account-select.vue +++ b/src/components/account-select.vue @@ -56,7 +56,12 @@ selectedAccount.value = accounts.value[newVal]; store.dispatch( "AccountStore/selectAccount", - {chain: accounts.value[newVal].chain, accountID: accounts.value[newVal].accountID} + { + chain: accounts.value[newVal].chain, + accountID: accounts.value[newVal].accountID + ? accounts.value[newVal].accountID + : accounts.value[newVal].accountName + } ); } }, {immediate: true}); diff --git a/src/components/dapps.vue b/src/components/dapps.vue index 00e8a916..008717b6 100644 --- a/src/components/dapps.vue +++ b/src/components/dapps.vue @@ -17,7 +17,12 @@ function fetchDapps() { let storedDapps = []; for (let i = 0; i < store.state.AccountStore.accountlist.length; i++) { - let apps = store.getters['OriginStore/walletAccessibleDapps'](store.state.AccountStore.accountlist[i].accountID, store.state.AccountStore.accountlist[i].chain); + let apps = store.getters['OriginStore/walletAccessibleDapps']( + store.state.AccountStore.accountlist[i].accountID + ? store.state.AccountStore.accountlist[i].accountID + : store.state.AccountStore.accountlist[i].accountName, + store.state.AccountStore.accountlist[i].chain + ); if (typeof apps != 'undefined') { storedDapps = storedDapps.concat(apps); } @@ -28,7 +33,12 @@ let dapps = computed(() => { let storedDapps = []; for (let i = 0; i < store.state.AccountStore.accountlist.length; i++) { - let apps = store.getters['OriginStore/walletAccessibleDapps'](store.state.AccountStore.accountlist[i].accountID, store.state.AccountStore.accountlist[i].chain); + let apps = store.getters['OriginStore/walletAccessibleDapps']( + store.state.AccountStore.accountlist[i].accountID + ? store.state.AccountStore.accountlist[i].accountID + : store.state.AccountStore.accountlist[i].accountName, + store.state.AccountStore.accountlist[i].chain + ); if (typeof apps != 'undefined') { storedDapps = storedDapps.concat(apps); } diff --git a/src/components/popups/identityrequestpopup.vue b/src/components/popups/identityrequestpopup.vue index cf3ef917..d42cdee8 100644 --- a/src/components/popups/identityrequestpopup.vue +++ b/src/components/popups/identityrequestpopup.vue @@ -28,7 +28,9 @@ if (!props.accounts || !props.accounts.length) { return ''; } - return props.accounts[0].accountID; + return props.accounts[0].accountID + ? props.accounts[0].accountID + : props.accounts[0].accountName; }); let accountName = computed(() => { diff --git a/src/components/popups/relinkrequestpopup.vue b/src/components/popups/relinkrequestpopup.vue index 2404d25f..ab86387d 100644 --- a/src/components/popups/relinkrequestpopup.vue +++ b/src/components/popups/relinkrequestpopup.vue @@ -36,6 +36,8 @@ origin: props.request.origin, chain: props.request.chain, accountId: props.accounts[0].accountID + ? props.accounts[0].accountID + : props.accounts[0].accountName } ); }); @@ -52,7 +54,9 @@ identityhash: props.request.payload.identityhash, name: props.accounts[0].accountName, chain: props.accounts[0].chain, - id: props.accounts[0].accountID, + id: props.accounts[0].accountID + ? props.accounts[0].accountID + : props.accounts[0].accountName, success: true }, request: { diff --git a/src/store/modules/AccountStore.js b/src/store/modules/AccountStore.js index 8c9a98b4..8f6baa2d 100644 --- a/src/store/modules/AccountStore.js +++ b/src/store/modules/AccountStore.js @@ -33,7 +33,10 @@ const actions = { state }, payload) { return new Promise((resolve, reject) => { - let existingAccount = state.accountlist.find(x => x.chain == payload.account.chain && x.accountID == payload.account.accountID) + let existingAccount = state.accountlist.find( + x => x.chain == payload.account.chain && + (x.accountID == payload.account.accountName || x.accountName === payload.account.accountName) + ); if (!existingAccount) { for (let keytype in payload.account.keys) { @@ -83,7 +86,14 @@ const actions = { return new Promise((resolve, reject) => { let index = -1; for (let i = 0; i < state.accountlist.length; i++) { - if ((payload.chain == state.accountlist[i].chain) && (payload.accountID == state.accountlist[i].accountID)) { + if ( + (payload.chain == state.accountlist[i].chain) && + ( + payload.accountID == state.accountlist[i].accountID || + payload.accountID == state.accountlist[i].accountName || + payload.accountName == state.accountlist[i].accountName + ) + ) { index = i; break; }