From bc1070f30a19b42785fa11e8f072775c009618a7 Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Mon, 26 Aug 2024 15:34:29 +0900
Subject: [PATCH] wip
---
.../frontend-embed/src/components/EmNote.vue | 34 ++++---------------
1 file changed, 7 insertions(+), 27 deletions(-)
diff --git a/packages/frontend-embed/src/components/EmNote.vue b/packages/frontend-embed/src/components/EmNote.vue
index 518df27e67..62cbff7263 100644
--- a/packages/frontend-embed/src/components/EmNote.vue
+++ b/packages/frontend-embed/src/components/EmNote.vue
@@ -26,7 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
-
+
@@ -85,7 +85,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ appearNote.channel.name }}
-
+
{{ i18n.ts.more }}
@@ -94,12 +94,9 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
-
-
-
@@ -124,14 +121,9 @@ import EmReactionsViewer from '@/components/EmReactionsViewer.vue';
import EmMediaList from '@/components/EmMediaList.vue';
import EmCwButton from '@/components/EmCwButton.vue';
import EmPoll from '@/components/EmPoll.vue';
-import { pleaseLogin, type OpenOnRemoteOptions } from '@/scripts/please-login.js';
import { userPage } from '@/utils.js';
-import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js';
import { i18n } from '@/i18n.js';
-import { deepClone } from '@/scripts/clone.js';
-import { getNoteSummary } from '@/scripts/get-note-summary.js';
-import { shouldCollapsed } from '@/scripts/collapsed.js';
-import { host } from '@/config.js';
+import { shouldCollapsed } from '@/to-be-shared/collapsed.js';
import { url } from '@/config.js';
function getAppearNote(note: Misskey.entities.Note) {
@@ -153,7 +145,7 @@ const inTimeline = inject('inTimeline', false);
const inChannel = inject('inChannel', null);
const currentClip = inject[ | null>('currentClip', null);
-const note = ref(deepClone(props.note));
+const note = ref((props.note));
const isRenote = Misskey.note.isPureRenote(note.value);
@@ -166,23 +158,11 @@ const clipButton = shallowRef();
const appearNote = computed(() => getAppearNote(note.value));
const showContent = ref(false);
const parsed = computed(() => appearNote.value.text ? mfm.parse(appearNote.value.text) : null);
-const urls = computed(() => parsed.value ? extractUrlFromMfm(parsed.value).filter((url) => appearNote.value.renote?.url !== url && appearNote.value.renote?.uri !== url) : null);
-const isLong = shouldCollapsed(appearNote.value, urls.value ?? []);
+const isLong = shouldCollapsed(appearNote.value, []);
const collapsed = ref(appearNote.value.cw == null && isLong);
const isDeleted = ref(false);
const translation = ref(null);
const translating = ref(false);
-const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || (appearNote.value.visibility === 'followers' && appearNote.value.userId === $i?.id));
-
-const pleaseLoginContext = computed(() => ({
- type: 'lookup',
- url: `https://${host}/notes/${appearNote.value.id}`,
-}));
-
-watch(() => props.note, (to) => {
- note.value = deepClone(to);
-}, { deep: true });
-
]