Skip to content

Commit ddd7315

Browse files
committed
fix: open external links in mobile correctly
1 parent 704e1d2 commit ddd7315

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/popup/components/AccountItem.vue

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<template>
22
<LinkButton
33
:to="explorerUrl"
4-
target="_blank"
54
class="account-item"
65
variant="muted"
76
>

src/popup/components/NotificationItem.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ import { useI18n } from 'vue-i18n';
6767
import type { INotification } from '@/types';
6868
import { relativeTimeTo } from '@/utils';
6969
import {
70+
IS_CORDOVA,
7071
IS_EXTENSION,
7172
IS_MOBILE_DEVICE,
7273
NOTIFICATION_STATUS_READ,
@@ -146,7 +147,11 @@ export default defineComponent({
146147
function handleClick() {
147148
if (props.notification.path) {
148149
if (typeof props.notification.path === 'string' && /^\w+:\D+/.test(props.notification.path)) {
149-
window.open(props.notification.path, IS_MOBILE_DEVICE ? '_self' : '_blank');
150+
if (IS_CORDOVA && window.cordova?.InAppBrowser?.open) {
151+
window.cordova.InAppBrowser.open(props.notification.path, '_system');
152+
} else {
153+
window.open(props.notification.path, '_blank');
154+
}
150155
} else {
151156
router.push(props.notification.path);
152157
}

src/protocols/aeternity/components/TransferReviewTip.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
class="subtitle"
99
scope="global"
1010
>
11-
<a
11+
<LinkButton
1212
:href="AGGREGATOR_URL"
13-
target="_blank"
1413
class="link"
1514
>
1615
{{ $t('pages.notifications.superhero') }}
17-
</a>
16+
</LinkButton>
1817
</i18n-t>
1918
</template>
2019
</ModalHeader>
@@ -81,6 +80,7 @@ import { AE_CONTRACT_ID } from '@/protocols/aeternity/config';
8180
import { useAccounts } from '@/composables';
8281
import { getDefaultAccountLabel } from '@/utils';
8382
83+
import LinkButton from '@/popup/components/LinkButton.vue';
8484
import ModalHeader from '@/popup/components/ModalHeader.vue';
8585
import TokenAmount from '@/popup/components/TokenAmount.vue';
8686
import FormTextarea from '@/popup/components/form/FormTextarea.vue';
@@ -92,6 +92,7 @@ export default {
9292
name: 'TransferReviewTip',
9393
components: {
9494
AddressTruncated,
95+
LinkButton,
9596
ModalHeader,
9697
TokenAmount,
9798
FormTextarea,

0 commit comments

Comments
 (0)