enhance(frontend): 自分のノートの添付ファイルから直接ファイルの詳細ページに飛べるようにする (#13520)
* enhance(frontend): 自分のノートの添付ファイルから直接ファイルの詳細ページに飛べるようにする * 他のファイルタイプにも対応 * Update Changelog --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
		| @@ -94,7 +94,7 @@ import * as os from '@/os.js'; | ||||
| import { isFullscreenNotSupported } from '@/scripts/device-kind.js'; | ||||
| import hasAudio from '@/scripts/media-has-audio.js'; | ||||
| import MkMediaRange from '@/components/MkMediaRange.vue'; | ||||
| import { iAmModerator } from '@/account.js'; | ||||
| import { $i, iAmModerator } from '@/account.js'; | ||||
|  | ||||
| const props = defineProps<{ | ||||
| 	video: Misskey.entities.DriveFile; | ||||
| @@ -122,8 +122,6 @@ function showMenu(ev: MouseEvent) { | ||||
|  | ||||
| 	if (iAmModerator) { | ||||
| 		menu.push({ | ||||
| 			type: 'divider', | ||||
| 		}, { | ||||
| 			text: props.video.isSensitive ? i18n.ts.unmarkAsSensitive : i18n.ts.markAsSensitive, | ||||
| 			icon: props.video.isSensitive ? 'ti ti-eye' : 'ti ti-eye-exclamation', | ||||
| 			danger: true, | ||||
| @@ -131,6 +129,17 @@ function showMenu(ev: MouseEvent) { | ||||
| 		}); | ||||
| 	} | ||||
|  | ||||
| 	if ($i?.id === props.video.userId) { | ||||
| 		menu.push({ | ||||
| 			type: 'divider', | ||||
| 		}, { | ||||
| 			type: 'link' as const, | ||||
| 			text: i18n.ts._fileViewer.title, | ||||
| 			icon: 'ti ti-info-circle', | ||||
| 			to: `/my/drive/file/${props.video.id}`, | ||||
| 		}); | ||||
| 	} | ||||
|  | ||||
| 	menuShowing.value = true; | ||||
| 	os.popupMenu(menu, ev.currentTarget ?? ev.target, { | ||||
| 		align: 'right', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 かっこかり
					かっこかり