Skip to content

Commit

Permalink
feat: handle need sig
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomariscal committed Jun 28, 2024
1 parent aca5dc5 commit 29f6f6e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions frontend/src/components/WithdrawForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
emit('initializeWithdraw');
setIsInWithdrawFlow(true);
"
:appendButtonLabel="$t('WithdrawForm.withdraw')"
:appendButtonDisable="isInWithdrawFlow || isFeeLoading"
:appendButtonLabel="needSignature ? $t('WithdrawForm.need-signature') : $t('WithdrawForm.withdraw')"
:appendButtonDisable="isInWithdrawFlow || isFeeLoading || needSignature"
:appendButtonLoading="isInWithdrawFlow"
:disable="isInWithdrawFlow"
:label="$t('WithdrawForm.address')"
Expand Down Expand Up @@ -119,11 +119,13 @@ export default defineComponent({
advancedMode: {
type: Boolean,
required: true,
default: true,
},
},
setup(data, { emit }) {
const { NATIVE_TOKEN } = useWalletStore();
const { setIsInWithdrawFlow, isInWithdrawFlow } = useStatusesStore();
const { needSignature } = useWalletStore();
const content = ref<string>(data.destinationAddress || '');
const nativeTokenSymbol = NATIVE_TOKEN.value.symbol;
Expand All @@ -138,6 +140,7 @@ export default defineComponent({
emitUpdateDestinationAddress,
content,
nativeTokenSymbol,
needSignature,
isInWithdrawFlow,
setIsInWithdrawFlow,
};
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
"view-on-explorer": "View on explorer"
},
"WithdrawForm": {
"need-signature": "Need Signature",
"withdraw-address": "Enter address to withdraw funds to",
"address": "Address",
"fetching-fee-estimate": "Fetching fee estimate...",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@
"view-on-explorer": "在区块链浏览器上查看"
},
"WithdrawForm": {
"need-signature": "此应用程序需要您的签名才能扫描您收到的资金",
"withdraw-address": "输入提款地址",
"address": "地址",
"fetching-fee-estimate": "在接收费用估计...",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/store/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ export default function useWalletStore() {
// "Direct" properties, i.e. return them directly without modification
balances: computed(() => balances.value),
stealthKeyRegistry: computed(() => stealthKeyRegistry.value),
hasKeys: computed(() => spendingKeyPair.value?.privateKeyHex && viewingKeyPair.value?.privateKeyHex),
hasKeys: computed(() => !!spendingKeyPair.value?.privateKeyHex && !!viewingKeyPair.value?.privateKeyHex),
network: computed(() => network.value),
isAccountSetup: computed(() => isAccountSetup.value),
isAccountSetupLegacy: computed(() => hasEnsKeys.value || hasCnsKeys.value), // LEGACY
Expand All @@ -615,6 +615,7 @@ export default function useWalletStore() {
tokens: computed(() => tokens.value),
userDisplayName: computed(() => userDisplayName.value),
connectedWalletLabel: computed(() => lastWallet),
needSignature: computed(() => !spendingKeyPair.value?.privateKeyHex || !viewingKeyPair.value?.privateKeyHex),
};
}

Expand Down

0 comments on commit 29f6f6e

Please sign in to comment.