Skip to content

Commit

Permalink
Fix reference to current name owner
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Feb 7, 2022
1 parent f86cd50 commit 594685f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/pages/aens/NameDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ export default {
...mapGetters(['currentNetwork']),
...mapState('names', {
details({ owned }) {
return owned && owned.names.find(({ name }) => name === this.name);
const entry = owned && owned.names.find(({ name }) => name === this.name);
return {
...entry,
owner: entry.accountId ?? entry.info.ownership.current,
};
},
isDefaultName(state, { getDefault }) {
return this.address && this.name === getDefault(this.address);
Expand All @@ -98,7 +102,7 @@ export default {
async extendName() {
const initialAccountIdx = this.$store.state.accounts.activeIdx;
const requredAccountIdx = this.$store.state.accounts.list
.findIndex(({ address }) => address === this.details.owner);
.findIndex(({ address }) => address === this.details.info.ownership.current);
if (initialAccountIdx !== requredAccountIdx) {
this.$store.commit('accounts/setActiveIdx', requredAccountIdx);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/aens/NameTransfer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default {
mounted() {
const initialAccountIdx = this.$store.state.accounts.activeIdx;
const requredAccountIdx = this.$store.state.accounts.list
.findIndex(({ address }) => address === this.nameEntry.owner);
.findIndex(({ address }) => address === this.nameEntry.info.ownership.current);
if (initialAccountIdx !== requredAccountIdx) {
this.$store.commit('accounts/setActiveIdx', requredAccountIdx);
this.$once('hook:destroyed', () => this.$store
Expand Down

0 comments on commit 594685f

Please sign in to comment.