@@ -14,10 +14,20 @@ SPDX-License-Identifier: AGPL-3.0-only
14
14
[$style.form_vertical]: chosen.place === 'vertical',
15
15
}]"
16
16
>
17
- <a :href="chosen.url" target="_blank" :class="$style.link">
17
+ <component
18
+ :is="self ? 'MkA' : 'a'"
19
+ :class="$style.link"
20
+ v-bind="self ? {
21
+ to: chosen.url.substring(local.length),
22
+ } : {
23
+ href: chosen.url,
24
+ rel: 'nofollow noopener',
25
+ target: '_blank',
26
+ }"
27
+ >
18
28
<img :src="chosen.imageUrl" :class="$style.img">
19
29
<button class="_button" :class="$style.i" @click.prevent.stop="toggleMenu"><i :class="$style.iIcon" class="ti ti-info-circle"></i></button>
20
- </a >
30
+ </component >
21
31
</div>
22
32
<div v-else :class="$style.menu">
23
33
<div :class="$style.menuContainer">
@@ -32,10 +42,10 @@ SPDX-License-Identifier: AGPL-3.0-only
32
42
</template>
33
43
34
44
<script lang="ts" setup>
35
- import { ref } from 'vue';
45
+ import { ref, computed } from 'vue';
36
46
import { i18n } from '@/i18n.js';
37
47
import { instance } from '@/instance.js';
38
- import { host } from '@/config.js';
48
+ import { url as local, host } from '@/config.js';
39
49
import MkButton from '@/components/MkButton.vue';
40
50
import { defaultStore } from '@/store.js';
41
51
import * as os from '@/os.js';
@@ -96,6 +106,9 @@ const choseAd = (): Ad | null => {
96
106
};
97
107
98
108
const chosen = ref(choseAd());
109
+
110
+ const self = computed(() => chosen.value?.url.startsWith(local));
111
+
99
112
const shouldHide = ref(!defaultStore.state.forceShowAds && $i && $i.policies.canHideAds && (props.specify == null));
100
113
101
114
function reduceFrequency(): void {
0 commit comments