enhance(frontend): 開発者モードでメニューからファイルIDをコピー出来るようにする (#15444)

This commit is contained in:
おさむのひと
2025-02-10 17:20:38 +09:00
committed by GitHub
parent dc608aada0
commit 420365c17f
5 changed files with 47 additions and 1 deletions

View File

@@ -113,6 +113,7 @@ import { ref, shallowRef, computed, watch, onDeactivated, onActivated, onMounted
import * as Misskey from 'misskey-js';
import type { MenuItem } from '@/types/menu.js';
import type { Keymap } from '@/scripts/hotkey.js';
import { copyToClipboard } from '@/scripts/copy-to-clipboard';
import bytes from '@/filters/bytes.js';
import { hms } from '@/filters/hms.js';
import { defaultStore } from '@/store.js';
@@ -252,6 +253,16 @@ function showMenu(ev: MouseEvent) {
});
}
if (defaultStore.state.devMode) {
menu.push({ type: 'divider' }, {
icon: 'ti ti-id',
text: i18n.ts.copyFileId,
action: () => {
copyToClipboard(props.video.id);
},
});
}
menuShowing.value = true;
os.popupMenu(menu, ev.currentTarget ?? ev.target, {
align: 'right',