@@ -238,6 +238,7 @@ import { isLink } from '@@/js/is-link.js';
238238import { host } from ' @@/js/config.js' ;
239239import type { OpenOnRemoteOptions } from ' @/utility/please-login.js' ;
240240import type { Keymap } from ' @/utility/hotkey.js' ;
241+ import type { MenuItem } from ' @/types/menu.js' ;
241242import MkNoteSub from ' @/components/MkNoteSub.vue' ;
242243import MkNoteSimple from ' @/components/MkNoteSimple.vue' ;
243244import MkReactionsViewer from ' @/components/MkReactionsViewer.vue' ;
@@ -286,7 +287,7 @@ const props = withDefaults(defineProps<{
286287 initialTab: ' replies' ,
287288});
288289
289- const inChannel = inject (' inChannel' , null );
290+ const inChannel = inject (DI . inChannel , null );
290291
291292let note = deepClone (props .note );
292293
@@ -581,18 +582,36 @@ async function showRenoteMenu() {
581582 const isLoggedIn = await pleaseLogin ({ openOnRemote: pleaseLoginContext .value });
582583 if (! isLoggedIn ) return ;
583584
584- os .popupMenu ([{
585- text: i18n .ts .unrenote ,
586- icon: ' ti ti-trash' ,
587- danger: true ,
588- action : () => {
589- misskeyApi (' notes/delete' , {
590- noteId: note .id ,
591- }).then (() => {
592- globalEvents .emit (' noteDeleted' , note .id );
593- });
594- },
595- }], renoteTime .value );
585+ const menu: MenuItem [] = [];
586+
587+ if (isMyRenote ) {
588+ menu .push ({
589+ text: i18n .ts .unrenote ,
590+ icon: ' ti ti-trash' ,
591+ danger: true ,
592+ action : () => {
593+ misskeyApi (' notes/delete' , {
594+ noteId: note .id ,
595+ }).then (() => {
596+ globalEvents .emit (' noteDeleted' , note .id );
597+ });
598+ },
599+ });
600+ }
601+
602+ if (
603+ props .note .channelId != null &&
604+ (inChannel == null || props .note .channelId !== inChannel .value )
605+ ) {
606+ menu .push ({
607+ type: ' link' ,
608+ text: i18n .ts .viewRenotedChannel ,
609+ icon: ' ti ti-device-tv' ,
610+ to: ` /channels/${props .note .channelId } ` ,
611+ });
612+ }
613+
614+ os .popupMenu (menu , renoteTime .value );
596615}
597616
598617function focus() {
0 commit comments