summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkNoteDetailed.vue
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend/src/components/MkNoteDetailed.vue')
-rw-r--r--packages/frontend/src/components/MkNoteDetailed.vue37
1 files changed, 23 insertions, 14 deletions
diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue
index 47bf365877..083e3e5da0 100644
--- a/packages/frontend/src/components/MkNoteDetailed.vue
+++ b/packages/frontend/src/components/MkNoteDetailed.vue
@@ -17,7 +17,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<MkNoteSub v-for="note in conversation" :key="note.id" :class="$style.replyToMore" :note="note"/>
</div>
- <MkNoteSub v-if="appearNote.replyId" :note="appearNote.reply" :class="$style.replyTo"/>
+ <MkNoteSub v-if="appearNote.replyId" :note="appearNote?.reply ?? null" :class="$style.replyTo"/>
<div v-if="isRenote" :class="$style.renote">
<MkAvatar :class="$style.renoteAvatar" :user="note.user" link preview/>
<i class="ti ti-repeat" style="margin-right: 4px;"></i>
@@ -143,8 +143,6 @@ SPDX-License-Identifier: AGPL-3.0-only
:reactionEmojis="$appearNote.reactionEmojis"
:myReaction="$appearNote.myReaction"
:noteId="appearNote.id"
- :maxNumber="16"
- @mockUpdateMyReaction="emitUpdReaction"
/>
<button class="_button" :class="$style.noteFooterButton" @click="reply()">
<i class="ti ti-arrow-back-up"></i>
@@ -233,7 +231,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
-import { computed, inject, markRaw, onMounted, provide, ref, useTemplateRef } from 'vue';
+import { computed, inject, markRaw, provide, ref, useTemplateRef } from 'vue';
import * as mfm from 'mfm-js';
import * as Misskey from 'misskey-js';
import { isLink } from '@@/js/is-link.js';
@@ -358,7 +356,9 @@ const keymap = {
if (!prefer.s.showClipButtonInNoteFooter) return;
clip();
},
- 'o': () => galleryEl.value?.openGallery(),
+ 'o': () => {
+ galleryEl.value?.openGallery();
+ },
'v|enter': () => {
if (appearNote.cw != null) {
showContent.value = !showContent.value;
@@ -448,8 +448,10 @@ if (appearNote.reactionAcceptance === 'likeOnly') {
});
}
-function renote() {
- pleaseLogin({ openOnRemote: pleaseLoginContext.value });
+async function renote() {
+ const isLoggedIn = await pleaseLogin({ openOnRemote: pleaseLoginContext.value });
+ if (!isLoggedIn) return;
+
showMovedDialog();
const { menu } = getRenoteMenu({ note: note, renoteButton });
@@ -459,8 +461,10 @@ function renote() {
subscribeManuallyToNoteCapture();
}
-function reply(): void {
- pleaseLogin({ openOnRemote: pleaseLoginContext.value });
+async function reply() {
+ const isLoggedIn = await pleaseLogin({ openOnRemote: pleaseLoginContext.value });
+ if (!isLoggedIn) return;
+
showMovedDialog();
os.post({
reply: appearNote,
@@ -470,8 +474,10 @@ function reply(): void {
});
}
-function react(): void {
- pleaseLogin({ openOnRemote: pleaseLoginContext.value });
+async function react() {
+ const isLoggedIn = await pleaseLogin({ openOnRemote: pleaseLoginContext.value });
+ if (!isLoggedIn) return;
+
showMovedDialog();
if (appearNote.reactionAcceptance === 'likeOnly') {
sound.playMisskeySfx('reaction');
@@ -547,7 +553,7 @@ function toggleReact() {
}
}
-function onContextmenu(ev: MouseEvent): void {
+function onContextmenu(ev: PointerEvent): void {
if (ev.target && isLink(ev.target as HTMLElement)) return;
if (window.getSelection()?.toString() !== '') return;
@@ -569,9 +575,12 @@ async function clip(): Promise<void> {
os.popupMenu(await getNoteClipMenu({ note: note }), clipButton.value).then(focus);
}
-function showRenoteMenu(): void {
+async function showRenoteMenu() {
if (!isMyRenote) return;
- pleaseLogin({ openOnRemote: pleaseLoginContext.value });
+
+ const isLoggedIn = await pleaseLogin({ openOnRemote: pleaseLoginContext.value });
+ if (!isLoggedIn) return;
+
os.popupMenu([{
text: i18n.ts.unrenote,
icon: 'ti ti-trash',