From b8beb2d7d1883e8d4160b93584714feebd06f3bc Mon Sep 17 00:00:00 2001 From: taiyme <53635909+taiyme@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:28:57 +0900 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20isEnabledUrlPreview=20?= =?UTF-8?q?=E3=82=92=E3=83=AA=E3=82=A2=E3=82=AF=E3=83=86=E3=82=A3=E3=83=96?= =?UTF-8?q?=E3=81=AB=E5=88=A4=E5=AE=9A=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/components/MkLink.vue | 12 ++++++------ packages/frontend/src/components/global/MkUrl.vue | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/frontend/src/components/MkLink.vue b/packages/frontend/src/components/MkLink.vue index 7871d1b50d97..9051778c7dcd 100644 --- a/packages/frontend/src/components/MkLink.vue +++ b/packages/frontend/src/components/MkLink.vue @@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only import { computed, defineAsyncComponent, shallowRef } from 'vue'; import { url as local } from '@/config.js'; import { useTooltip } from '@/scripts/use-tooltip.js'; -import * as os from '@/os.js'; +import { popup } from '@/os.js'; import { isEnabledUrlPreview } from '@/instance.js'; import MkA, { type MkABehavior } from '@/components/global/MkA.vue'; @@ -46,15 +46,15 @@ const anchorElement = computed(() => { return rootEl.value.getAnchorElement(); }); -if (isEnabledUrlPreview.value) { - useTooltip(anchorElement, (showing) => { - os.popup(defineAsyncComponent(() => import('@/components/MkUrlPreviewPopup.vue')), { +useTooltip(anchorElement, (showing) => { + if (isEnabledUrlPreview.value && anchorElement.value != null) { + popup(defineAsyncComponent(() => import('@/components/MkUrlPreviewPopup.vue')), { showing, url: props.url, source: anchorElement.value, }, {}, 'closed'); - }); -} + } +});