summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkLink.vue
diff options
context:
space:
mode:
authorおさむのひと <46447427+samunohito@users.noreply.github.com>2024-03-21 18:46:42 +0900
committerGitHub <noreply@github.com>2024-03-21 18:46:42 +0900
commit831c74a25b2db0ba3f6d43a9a1a9072d342b2822 (patch)
tree5ad9371369ef6a346e0ca27bc6dea1682044df52 /packages/frontend/src/components/MkLink.vue
parentenhance(antenna): Botの投稿を除外できるように (#13603) (diff)
downloadmisskey-831c74a25b2db0ba3f6d43a9a1a9072d342b2822.tar.gz
misskey-831c74a25b2db0ba3f6d43a9a1a9072d342b2822.tar.bz2
misskey-831c74a25b2db0ba3f6d43a9a1a9072d342b2822.zip
fix: URLプレビューの動作改善+動作設定を可能にする (#13579)
* wip * support new version * URLプレビュー無効化時、フロント側も非表示にしてリクエストをしないようにする * fix lint * fix lint * tweak preview request error handles * fix: CHANGELOG.md * fix * fix --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/frontend/src/components/MkLink.vue')
-rw-r--r--packages/frontend/src/components/MkLink.vue17
1 files changed, 10 insertions, 7 deletions
diff --git a/packages/frontend/src/components/MkLink.vue b/packages/frontend/src/components/MkLink.vue
index 3f7aba2fe4..ca875242b4 100644
--- a/packages/frontend/src/components/MkLink.vue
+++ b/packages/frontend/src/components/MkLink.vue
@@ -18,6 +18,7 @@ import { defineAsyncComponent, ref } from 'vue';
import { url as local } from '@/config.js';
import { useTooltip } from '@/scripts/use-tooltip.js';
import * as os from '@/os.js';
+import { isEnabledUrlPreview } from '@/instance.js';
const props = withDefaults(defineProps<{
url: string;
@@ -31,13 +32,15 @@ const target = self ? null : '_blank';
const el = ref<HTMLElement | { $el: HTMLElement }>();
-useTooltip(el, (showing) => {
- os.popup(defineAsyncComponent(() => import('@/components/MkUrlPreviewPopup.vue')), {
- showing,
- url: props.url,
- source: el.value instanceof HTMLElement ? el.value : el.value?.$el,
- }, {}, 'closed');
-});
+if (isEnabledUrlPreview.value) {
+ useTooltip(el, (showing) => {
+ os.popup(defineAsyncComponent(() => import('@/components/MkUrlPreviewPopup.vue')), {
+ showing,
+ url: props.url,
+ source: el.value instanceof HTMLElement ? el.value : el.value?.$el,
+ }, {}, 'closed');
+ });
+}
</script>
<style lang="scss" module>