Commit b8beb2d 1 parent 15ca917 commit b8beb2d Copy full SHA for b8beb2d
File tree 2 files changed +12
-12
lines changed
packages/frontend/src/components
2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
24
24
import { computed, defineAsyncComponent, shallowRef } from 'vue';
25
25
import { url as local } from '@/config.js';
26
26
import { useTooltip } from '@/scripts/use-tooltip.js';
27
- import * as os from '@/os.js';
27
+ import { popup } from '@/os.js';
28
28
import { isEnabledUrlPreview } from '@/instance.js';
29
29
import MkA, { type MkABehavior } from '@/components/global/MkA.vue';
30
30
@@ -46,15 +46,15 @@ const anchorElement = computed(() => {
46
46
return rootEl.value.getAnchorElement();
47
47
});
48
48
49
- if (isEnabledUrlPreview.value) {
50
- useTooltip(anchorElement, (showing) => {
51
- os. popup(defineAsyncComponent(() => import('@/components/MkUrlPreviewPopup.vue')), {
49
+ useTooltip(anchorElement, (showing) => {
50
+ if (isEnabledUrlPreview.value && anchorElement.value != null) {
51
+ popup(defineAsyncComponent(() => import('@/components/MkUrlPreviewPopup.vue')), {
52
52
showing,
53
53
url: props.url,
54
54
source: anchorElement.value,
55
55
}, {}, 'closed');
56
- });
57
- }
56
+ }
57
+ });
58
58
</script>
59
59
60
60
<style lang="scss" module>
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-only
34
34
import { computed, defineAsyncComponent, shallowRef } from 'vue';
35
35
import { toUnicode as decodePunycode } from 'punycode/';
36
36
import { url as local } from '@/config.js';
37
- import * as os from '@/os.js';
37
+ import { popup } from '@/os.js';
38
38
import { useTooltip } from '@/scripts/use-tooltip.js';
39
39
import { safeURIDecode } from '@/scripts/safe-uri-decode.js';
40
40
import { isEnabledUrlPreview } from '@/instance.js';
@@ -60,15 +60,15 @@ const anchorElement = computed(() => {
60
60
return rootEl.value.getAnchorElement();
61
61
});
62
62
63
- if (props.showUrlPreview && isEnabledUrlPreview.value) {
64
- useTooltip(anchorElement, (showing) => {
65
- os. popup(defineAsyncComponent(() => import('@/components/MkUrlPreviewPopup.vue')), {
63
+ useTooltip(anchorElement, (showing) => {
64
+ if (props.showUrlPreview && isEnabledUrlPreview.value && anchorElement.value != null) {
65
+ popup(defineAsyncComponent(() => import('@/components/MkUrlPreviewPopup.vue')), {
66
66
showing,
67
67
url: props.url,
68
68
source: anchorElement.value,
69
69
}, {}, 'closed');
70
- });
71
- }
70
+ }
71
+ });
72
72
73
73
const schema = url.protocol;
74
74
const hostname = decodePunycode(url.hostname);
You can’t perform that action at this time.
0 commit comments