Skip to content

Commit 49c1f68

Browse files
committed
fix: prevent transfer send opening on unsupported deeplinks
1 parent 25f5351 commit 49c1f68

39 files changed

+225
-84
lines changed

src/popup/components/AccountCardMultisig.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
</template>
1212

1313
<template #middle>
14-
<BalanceInfo :balance="+account.balance" />
14+
<BalanceInfo
15+
:balance="+account.balance"
16+
:protocol="PROTOCOL_AETERNITY"
17+
/>
1518
</template>
1619

1720
<template #bottom>

src/popup/components/AccountInfo.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ import {
6767
import type { Protocol } from '@/types';
6868
import { getDefaultAccountLabel } from '@/utils';
6969
import { ProtocolAdapterFactory } from '@/lib/ProtocolAdapterFactory';
70-
import { PROTOCOL_AETERNITY } from '@/constants';
7170
7271
import Avatar from './Avatar.vue';
7372
import CopyText from './CopyText.vue';
@@ -86,7 +85,7 @@ export default defineComponent({
8685
props: {
8786
address: { type: String, required: true },
8887
name: { type: String, default: '' },
89-
protocol: { type: String as PropType<Protocol>, default: PROTOCOL_AETERNITY },
88+
protocol: { type: String as PropType<Protocol>, required: true },
9089
avatarSize: { type: String, default: 'lg' },
9190
idx: { type: Number, default: 0 },
9291
canCopyAddress: Boolean,

src/popup/components/AccountItem.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
<script lang="ts">
4747
import { defineComponent, computed, PropType } from 'vue';
4848
import type { Protocol } from '@/types';
49-
import { PROTOCOL_AETERNITY } from '@/constants';
5049
5150
import { ProtocolAdapterFactory } from '@/lib/ProtocolAdapterFactory';
5251
import AddressTruncated from './AddressTruncated.vue';
@@ -73,7 +72,7 @@ export default defineComponent({
7372
props: {
7473
address: { type: String, required: true },
7574
name: { type: String, default: '' },
76-
protocol: { type: String as PropType<Protocol>, default: PROTOCOL_AETERNITY },
75+
protocol: { type: String as PropType<Protocol>, required: true },
7776
size: {
7877
type: String,
7978
default: 'rg',

src/popup/components/AccountSelectOptionsItem.vue

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
/>
2121
<TokenAmount
2222
:amount="balance"
23-
:symbol="AE_SYMBOL"
23+
:symbol="tokenSymbol"
24+
:protocol="account.protocol"
2425
fiat-below
2526
class="token-amount"
2627
small
@@ -41,6 +42,7 @@ import { useBalances } from '@/composables';
4142
import { getAddressColor } from '@/utils';
4243
import { AE_SYMBOL } from '@/protocols/aeternity/config';
4344
45+
import { ProtocolAdapterFactory } from '@/lib/ProtocolAdapterFactory';
4446
import AccountInfo from './AccountInfo.vue';
4547
import BtnPlain from './buttons/BtnPlain.vue';
4648
import TokenAmount from './TokenAmount.vue';
@@ -70,9 +72,14 @@ export default defineComponent({
7072
: 0,
7173
);
7274
75+
const tokenSymbol = computed(
76+
() => ProtocolAdapterFactory.getAdapter(props.account.protocol!).getCoinSymbol(true),
77+
);
78+
7379
return {
7480
balance,
7581
bgColorStyle,
82+
tokenSymbol,
7683
AE_SYMBOL,
7784
};
7885
},

src/popup/components/AddressTruncated.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import {
3333
} from 'vue';
3434
import type { Protocol } from '@/types';
3535
import { truncateAddress } from '@/utils';
36-
import { PROTOCOL_AETERNITY } from '@/constants';
3736
import { ProtocolAdapterFactory } from '@/lib/ProtocolAdapterFactory';
3837
3938
import ExternalLinkIcon from '@/icons/external-link.svg?vue-component';
@@ -48,9 +47,9 @@ export default defineComponent({
4847
},
4948
props: {
5049
address: { type: String, required: true },
50+
protocol: { type: String as PropType<Protocol>, required: true },
5151
showExplorerLink: Boolean,
5252
showProtocolIcon: Boolean,
53-
protocol: { type: String as PropType<Protocol>, default: PROTOCOL_AETERNITY },
5453
},
5554
setup(props) {
5655
const truncatedAddress = computed(() => truncateAddress(props.address));

src/popup/components/AuctionOverview.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<div class="auction-overview">
33
<DetailsItem :label="$t('pages.auctionBid.current-highest-bid')">
44
<template #value>
5-
<TokenAmount :amount="amount" />
5+
<TokenAmount
6+
:amount="amount"
7+
:protocol="PROTOCOL_AETERNITY"
8+
/>
69
</template>
710
</DetailsItem>
811
<DetailsItem
@@ -21,6 +24,7 @@ import { IAuction, IAuctionBid } from '@/types';
2124
import { blocksToRelativeTime } from '@/utils';
2225
import { useTopHeaderData } from '@/composables';
2326
import { useGetter } from '@/composables/vuex';
27+
import { PROTOCOL_AETERNITY } from '@/constants';
2428
2529
import DetailsItem from './DetailsItem.vue';
2630
import TokenAmount from './TokenAmount.vue';
@@ -47,6 +51,7 @@ export default defineComponent({
4751
const endHeight = computed(() => blocksToRelativeTime(blocksToExpiry.value));
4852
4953
return {
54+
PROTOCOL_AETERNITY,
5055
blocksToRelativeTime,
5156
auction,
5257
amount,

src/popup/components/BalanceInfo.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import {
3030
import { useStore } from 'vuex';
3131
import type { Protocol } from '@/types';
3232
import { useConnection, useCurrencies } from '@/composables';
33-
import { PROTOCOL_AETERNITY } from '@/constants';
3433
import MainBalance from './MainBalance.vue';
3534
import MessageOffline from './MessageOffline.vue';
3635
@@ -41,7 +40,7 @@ export default defineComponent({
4140
},
4241
props: {
4342
balance: { type: Number, required: true },
44-
protocol: { type: String as PropType<Protocol>, default: PROTOCOL_AETERNITY },
43+
protocol: { type: String as PropType<Protocol>, required: true },
4544
horizontalOfflineMessage: Boolean,
4645
},
4746
setup(props) {

src/popup/components/FungibleTokens/TokensListItem.vue

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
:amount="+tokenData.convertedBalance || 0"
2424
:symbol="tokenData.symbol"
2525
:aex9="isTokenAeCoin"
26+
:protocol="PROTOCOL_AETERNITY"
2627
dynamic-sizing
2728
no-symbol
2829
hide-fiat
@@ -97,6 +98,7 @@ export default defineComponent({
9798
});
9899
99100
return {
101+
PROTOCOL_AETERNITY,
100102
isTokenAeCoin,
101103
price,
102104
targetRouteName,

src/popup/components/InputAmount.vue

+1-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ import {
7575
useCurrencies,
7676
} from '@/composables';
7777
import type { IAsset, Protocol } from '@/types';
78-
import { PROTOCOL_AETERNITY } from '@/constants';
7978
import { ProtocolAdapterFactory } from '@/lib/ProtocolAdapterFactory';
8079
import InputField from './InputField.vue';
8180
import InputSelectAsset from './InputSelectAsset.vue';
@@ -91,8 +90,7 @@ export default defineComponent({
9190
selectedAsset: { type: Object as PropType<IAsset | null>, default: null },
9291
readonly: Boolean,
9392
showTokensWithBalance: Boolean,
94-
// TODO - handle usages & make protocol required
95-
protocol: { type: String as PropType<Protocol>, default: PROTOCOL_AETERNITY },
93+
protocol: { type: String as PropType<Protocol>, required: true },
9694
},
9795
emits: ['update:modelValue', 'asset-selected'],
9896
setup(props, { emit }) {

src/popup/components/InviteItem.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<template>
22
<div class="invite-row">
33
<div class="invite-info">
4-
<TokenAmount :amount="inviteLinkBalance" />
4+
<TokenAmount
5+
:amount="inviteLinkBalance"
6+
:protocol="PROTOCOL_AETERNITY"
7+
/>
58
<span class="date">{{ formatDate(createdAt) }}</span>
69
</div>
710
<CopyText
@@ -51,6 +54,7 @@
5154
class="input-amount"
5255
:label="$t('pages.invite.top-up-with')"
5356
:message="errorMessage"
57+
:protocol="PROTOCOL_AETERNITY"
5458
readonly
5559
/>
5660
<div class="centered-buttons">
@@ -226,6 +230,7 @@ export default defineComponent({
226230
);
227231
228232
return {
233+
PROTOCOL_AETERNITY,
229234
formModel,
230235
max,
231236
topUp,

src/popup/components/Modals/ConfirmTransactionSign.vue

+12-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<TransactionOverview
1515
:transaction="completeTransaction"
1616
/>
17-
1817
<DetailsItem
1918
v-if="!!error"
2019
:label="$t('pages.transactionDetails.reason')"
@@ -39,7 +38,10 @@
3938
class="name-fee"
4039
>
4140
<template #value>
42-
<TokenAmount :amount="nameAeFee" />
41+
<TokenAmount
42+
:amount="nameAeFee"
43+
:protocol="PROTOCOL_AETERNITY"
44+
/>
4345
</template>
4446
</DetailsItem>
4547

@@ -53,13 +55,15 @@
5355
:symbol="tokenSymbol"
5456
:aex9="isTransactionAex9(transactionWrapped)"
5557
:hide-fiat="!swapTokenAmountData.isAe"
58+
:protocol="PROTOCOL_AETERNITY"
5659
data-cy="total"
5760
/>
5861
</DetailsItem>
5962

6063
<DetailsItem :label="$t('transaction.fee')">
6164
<TokenAmount
6265
:amount="txAeFee"
66+
:protocol="PROTOCOL_AETERNITY"
6367
data-cy="fee"
6468
/>
6569
</DetailsItem>
@@ -72,6 +76,7 @@
7276
:amount="executionCost || totalAmount"
7377
:symbol="getTxSymbol(popupProps?.tx)"
7478
:aex9="isTransactionAex9(transactionWrapped)"
79+
:protocol="PROTOCOL_AETERNITY"
7580
data-cy="total"
7681
/>
7782
</DetailsItem>
@@ -138,7 +143,10 @@ import type {
138143
} from '@/types';
139144
import { tg } from '@/store/plugins/languages';
140145
import { RejectedByUserError } from '@/lib/errors';
141-
import { PROTOCOL_AETERNITY, TX_DIRECTION } from '@/constants';
146+
import {
147+
PROTOCOL_AETERNITY,
148+
TX_DIRECTION,
149+
} from '@/constants';
142150
import {
143151
fetchJson,
144152
handleUnknownError,
@@ -468,6 +476,7 @@ export default defineComponent({
468476
return {
469477
AnimatedSpinner,
470478
AE_SYMBOL,
479+
PROTOCOL_AETERNITY,
471480
TX_FIELDS_TO_DISPLAY,
472481
error,
473482
executionCost,

src/popup/components/Modals/MultisigProposalConfirmActions.vue

+7-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434

3535
<div>
3636
<div class="active-account">
37-
<AccountItem :address="activeAccount.address" />
37+
<AccountItem
38+
:address="activeAccount.address"
39+
:protocol="PROTOCOL_AETERNITY"
40+
/>
3841
</div>
3942

4043
<div
@@ -87,6 +90,7 @@ import type {
8790
import { useAccounts, useMultisigAccounts, usePendingMultisigTransaction } from '@/composables';
8891
import { TX_FUNCTIONS_MULTISIG } from '@/protocols/aeternity/config';
8992
93+
import { PROTOCOL_AETERNITY } from '@/constants';
9094
import Modal from '../Modal.vue';
9195
import FormSelect from '../form/FormSelect.vue';
9296
import BtnMain from '../buttons/BtnMain.vue';
@@ -178,6 +182,8 @@ export default defineComponent({
178182
}
179183
180184
return {
185+
PROTOCOL_AETERNITY,
186+
TX_FUNCTIONS_MULTISIG,
181187
statusIcon,
182188
closeModal,
183189
eligibleAccounts,
@@ -186,7 +192,6 @@ export default defineComponent({
186192
activeMultisigAccount,
187193
confirmActionContent,
188194
actionHasError,
189-
TX_FUNCTIONS_MULTISIG,
190195
};
191196
},
192197
});

src/popup/components/Modals/RecipientInfo.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default defineComponent({
8888
},
8989
props: {
9090
resolve: { type: Function as PropType<ResolveCallback>, required: true },
91-
protocol: { type: String as PropType<Protocol>, default: PROTOCOL_AETERNITY },
91+
protocol: { type: String as PropType<Protocol>, required: true },
9292
close: { type: Function, default: null },
9393
},
9494
setup(props) {

src/popup/components/Modals/TransferReceiveBase.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ import type {
111111
} from '@/types';
112112
import {
113113
IS_MOBILE_DEVICE,
114-
PROTOCOL_AETERNITY,
115114
PROTOCOL_BITCOIN,
116115
} from '@/constants';
117116
import { RouteQueryActionsController } from '@/lib/RouteQueryActionsController';
@@ -155,7 +154,7 @@ export default defineComponent({
155154
accountName: { type: String, default: null },
156155
tokens: { type: Object as PropType<ITokenList>, default: () => ({}) },
157156
disableAssetSelection: Boolean,
158-
protocol: { type: String as PropType<Protocol>, default: PROTOCOL_AETERNITY },
157+
protocol: { type: String as PropType<Protocol>, required: true },
159158
},
160159
setup(props) {
161160
const store = useStore();

src/popup/components/MultisigProposalConsensus.vue

+10-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
:key="signer"
3232
class="signer"
3333
>
34-
<AccountItem :address="signer" />
34+
<AccountItem
35+
:address="signer"
36+
:protocol="PROTOCOL_AETERNITY"
37+
/>
3538

3639
<CheckCircle
3740
v-if="pendingMultisigTxConfirmedBy.includes(signer) || proposalCompleted"
@@ -65,7 +68,10 @@
6568
import { computed, defineComponent } from 'vue';
6669
import { TranslateResult, useI18n } from 'vue-i18n';
6770
import { useStore } from 'vuex';
68-
import { MODAL_CONSENSUS_INFO } from '@/constants';
71+
import {
72+
MODAL_CONSENSUS_INFO,
73+
PROTOCOL_AETERNITY,
74+
} from '@/constants';
6975
import {
7076
useAccounts,
7177
useModals,
@@ -171,7 +177,7 @@ export default defineComponent({
171177
return {
172178
content: t('pages.proposalDetails.infoBox.pending', [
173179
pendingMultisigTxPendingConfirmationsCount.value,
174-
pendingMultisigTxPendingConfirmationsCount.value > 1
180+
(pendingMultisigTxPendingConfirmationsCount.value > 1)
175181
? t('pages.proposalDetails.infoBox.signatures')
176182
: t('pages.proposalDetails.infoBox.signature'),
177183
]),
@@ -184,6 +190,7 @@ export default defineComponent({
184190
}
185191
186192
return {
193+
PROTOCOL_AETERNITY,
187194
activeMultisigAccount,
188195
isLocalAccountAddress,
189196
infoBox,

src/popup/components/MultisigVaultCreateReview.vue

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
<TokenAmount
6666
:amount="fee"
6767
:symbol="AE_SYMBOL"
68+
:protocol="PROTOCOL_AETERNITY"
6869
/>
6970
</template>
7071
</DetailsItem>

0 commit comments

Comments
 (0)