Skip to content

Commit

Permalink
fix account sign
Browse files Browse the repository at this point in the history
  • Loading branch information
zlayine committed Oct 7, 2024
1 parent deaf41c commit 6d895ed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion resources/js/components/SignTransaction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const signing = ref(false);
const transactionStore = useTransactionStore();
const connectionStore = useConnectionStore();
const walletAccounts = computed(() => connectionStore.getWalletAccounts());
const walletAccounts = computed(() => connectionStore.getWalletAccounts().filter((account) => account.enabled));
const signTransaction = async () => {
try {
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/pages/SettingsWalletApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<template v-else>
<WalletAppItem
v-for="item in userWalletAccounts"
:key="item.account"
:account="item.account"
:key="item.address"
:account="item.address"
:enabled="item.enabled"
/>
</template>
Expand Down
12 changes: 6 additions & 6 deletions resources/js/store/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,16 @@ export const useConnectionStore = defineStore('connection', {
return [...new Set(accounts)];
},
getWalletAccounts() {
let accounts =
useAppStore().user?.walletAccounts ||
this.accounts?.map((account) => publicKeyToAddress(account.address));
let accounts = this.accounts?.map((account) => {
return { ...account, address: publicKeyToAddress(account.address) };
});
try {
accounts = accounts?.map((account) => {
if (this.disabledAccounts?.find((disabled) => disabled === account)) {
return { account, enabled: false };
if (this.disabledAccounts?.find((disabled) => disabled === account.address)) {
return { ...account, enabled: false };
}

return { account, enabled: true };
return { ...account, enabled: true };
});
} catch {
//
Expand Down

0 comments on commit 6d895ed

Please sign in to comment.