Skip to content

Commit

Permalink
feat: show names in address book
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandros Kalogerakis committed Nov 4, 2024
1 parent 783e296 commit 54c139c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
8 changes: 1 addition & 7 deletions src/composables/accountSelector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useAddressBook } from '@/composables/addressBook';
import { ref, watch } from 'vue';
import { ref } from 'vue';
import { ACCOUNT_SELECT_TYPE_FILTER, AccountSelectTypeFilter } from '@/constants';
import { createCustomScopedComposable } from '@/utils';

Expand All @@ -26,12 +26,6 @@ export const useAccountSelector = createCustomScopedComposable(() => {
addressBookClearFilters(resetProtocolFilter);
}

watch(showBookmarked, (val) => {
if (!val) {
accountSelectType.value = ACCOUNT_SELECT_TYPE_FILTER.addressBook;
}
});

return {
accountSelectType,
addressBookFiltered,
Expand Down
1 change: 1 addition & 0 deletions src/constants/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ export const PASSWORD_STRENGTH = {
} as const;

export const ACCOUNT_SELECT_TYPE_FILTER = {
all: 'all',
bookmarked: 'bookmarked',
owned: 'owned',
addressBook: 'addressBook',
Expand Down
8 changes: 4 additions & 4 deletions src/popup/components/AddressBook/AddressBookList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ import { AE_TRANSACTION_OWNERSHIP_STATUS } from '@/protocols/aeternity/config';
import { ACCOUNT_SELECT_TYPE_FILTER, PROTOCOLS, TX_DIRECTION } from '@/constants';
import { useAeNames } from '@/protocols/aeternity/composables/aeNames';
import { useAeMiddleware } from '@/protocols/aeternity/composables';
import { getDefaultAccountLabel } from '@/utils';
export default defineComponent({
components: {
Expand Down Expand Up @@ -131,16 +132,15 @@ export default defineComponent({
} = useAccountSelector();
const ownAddresses = computed(() => {
if (protocolFilter.value) {
return accountsGroupedByProtocol.value[protocolFilter.value]?.map((accountAddress) => (
return accountsGroupedByProtocol.value[protocolFilter.value]?.map((account) => (
{
name: protocolFilter.value === PROTOCOLS.aeternity ? getName(accountAddress.address).value : '',
address: accountAddress.address,
name: getName(account.address).value || getDefaultAccountLabel(account),
address: account.address,
isBookmarked: false,
protocol: protocolFilter.value ?? PROTOCOLS.aeternity,
}
));
}
return [];
});
const { accountsTransactionsLatest } = useLatestTransactionList();
Expand Down

0 comments on commit 54c139c

Please sign in to comment.