summaryrefslogtreecommitdiff
path: root/packages/frontend/src/utility/get-note-menu.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-05-09 17:40:08 +0900
committerGitHub <noreply@github.com>2025-05-09 17:40:08 +0900
commit8c2ab25e5f2040fcbc81bc2a02a279fed40e1c11 (patch)
treeae0d3573bd5a3175bc6174d33129dc64205a1436 /packages/frontend/src/utility/get-note-menu.ts
parentrefactor (diff)
downloadmisskey-8c2ab25e5f2040fcbc81bc2a02a279fed40e1c11.tar.gz
misskey-8c2ab25e5f2040fcbc81bc2a02a279fed40e1c11.tar.bz2
misskey-8c2ab25e5f2040fcbc81bc2a02a279fed40e1c11.zip
Feat: No websocket mode (#15851)
* wip * wip * wip * wip * Update MkTimeline.vue * wip * wip * wip * Update MkTimeline.vue * Update use-pagination.ts * wip * wip * Update MkTimeline.vue * Update MkTimeline.vue * wip * wip * Update MkTimeline.vue * Update MkTimeline.vue * Update MkTimeline.vue * wip * Update use-pagination.ts * wip * Update use-pagination.ts * Update MkNotifications.vue * Update MkNotifications.vue * wip * wip * wip * Update use-note-capture.ts * Update use-note-capture.ts * Update use-note-capture.ts * wip * wip * wip * wip * Update MkNoteDetailed.vue * wip * wip * Update MkTimeline.vue * wip * fix * Update MkTimeline.vue * wip * test * Revert "test" This reverts commit 3375619396c54dcda5e564eb1da444c2391208c9. * Update use-pagination.ts * test * Revert "test" This reverts commit 42c53c830e28485d2fb49061fa7cdeee31bc6a22. * test * Revert "test" This reverts commit c4f8cda4aa1cec9d1eb97557145f3ad3d2d0e469. * Update style.scss * Update MkTimeline.vue * Update MkTimeline.vue * Update MkTimeline.vue * ✌️ * Update MkTimeline.vue * wip * wip * test * Update MkPullToRefresh.vue * Update MkPullToRefresh.vue * Update MkPullToRefresh.vue * Update MkPullToRefresh.vue * Update MkTimeline.vue * wip * tweak navbar * wip * wip * wip * wip * wip * wip * wip * Update home.vue * wip * refactor * wip * wip * Update note.vue * Update navbar.vue * Update MkPullToRefresh.vue * Update MkPullToRefresh.vue * Update MkPullToRefresh.vue * wip * Update MkStreamingNotificationsTimeline.vue * Update use-pagination.ts * wip * improve perf * wip * Update MkNotesTimeline.vue * wip * megre * Update use-pagination.ts * Update use-pagination.ts * Update MkStreamingNotesTimeline.vue * Update use-pagination.ts * Update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md
Diffstat (limited to 'packages/frontend/src/utility/get-note-menu.ts')
-rw-r--r--packages/frontend/src/utility/get-note-menu.ts18
1 files changed, 11 insertions, 7 deletions
diff --git a/packages/frontend/src/utility/get-note-menu.ts b/packages/frontend/src/utility/get-note-menu.ts
index dd8bdf43d7..dc813cb78e 100644
--- a/packages/frontend/src/utility/get-note-menu.ts
+++ b/packages/frontend/src/utility/get-note-menu.ts
@@ -25,10 +25,10 @@ import { getAppearNote } from '@/utility/get-appear-note.js';
import { genEmbedCode } from '@/utility/get-embed-code.js';
import { prefer } from '@/preferences.js';
import { getPluginHandlers } from '@/plugin.js';
+import { globalEvents } from '@/events.js';
export async function getNoteClipMenu(props: {
note: Misskey.entities.Note;
- isDeleted: Ref<boolean>;
currentClip?: Misskey.entities.Clip;
}) {
function getClipName(clip: Misskey.entities.Clip) {
@@ -68,7 +68,6 @@ export async function getNoteClipMenu(props: {
}
}));
});
- if (props.currentClip?.id === clip.id) props.isDeleted.value = true;
}
} else if (err.id === 'f0dba960-ff73-4615-8df4-d6ac5d9dc118') {
os.alert({
@@ -178,7 +177,6 @@ export function getNoteMenu(props: {
note: Misskey.entities.Note;
translation: Ref<Misskey.entities.NotesTranslateResponse | null>;
translating: Ref<boolean>;
- isDeleted: Ref<boolean>;
currentClip?: Misskey.entities.Clip;
}) {
const appearNote = getAppearNote(props.note);
@@ -194,6 +192,8 @@ export function getNoteMenu(props: {
misskeyApi('notes/delete', {
noteId: appearNote.id,
+ }).then(() => {
+ globalEvents.emit('noteDeleted', appearNote.id);
});
if (Date.now() - new Date(appearNote.createdAt).getTime() < 1000 * 60 && appearNote.userId === $i.id) {
@@ -211,6 +211,8 @@ export function getNoteMenu(props: {
misskeyApi('notes/delete', {
noteId: appearNote.id,
+ }).then(() => {
+ globalEvents.emit('noteDeleted', appearNote.id);
});
os.post({ initialNote: appearNote, renote: appearNote.renote, reply: appearNote.reply, channel: appearNote.channel });
@@ -251,7 +253,6 @@ export function getNoteMenu(props: {
async function unclip(): Promise<void> {
if (!props.currentClip) return;
os.apiWithDialog('clips/remove-note', { clipId: props.currentClip.id, noteId: appearNote.id });
- props.isDeleted.value = true;
}
async function promote(): Promise<void> {
@@ -569,8 +570,9 @@ export function getRenoteMenu(props: {
misskeyApi('notes/create', {
renoteId: appearNote.id,
channelId: appearNote.channelId,
- }).then(() => {
+ }).then((res) => {
os.toast(i18n.ts.renoted);
+ globalEvents.emit('notePosted', res.createdNote);
});
}
},
@@ -617,8 +619,9 @@ export function getRenoteMenu(props: {
localOnly,
visibility,
renoteId: appearNote.id,
- }).then(() => {
+ }).then((res) => {
os.toast(i18n.ts.renoted);
+ globalEvents.emit('notePosted', res.createdNote);
});
}
},
@@ -658,8 +661,9 @@ export function getRenoteMenu(props: {
misskeyApi('notes/create', {
renoteId: appearNote.id,
channelId: channel.id,
- }).then(() => {
+ }).then((res) => {
os.toast(i18n.tsx.renotedToX({ name: channel.name }));
+ globalEvents.emit('notePosted', res.createdNote);
});
}
},