diff options
| author | yupix <yupi0982@outlook.jp> | 2023-05-14 01:30:46 +0000 |
|---|---|---|
| committer | yupix <yupi0982@outlook.jp> | 2023-05-14 01:30:46 +0000 |
| commit | f15f60d5b948d4aff002f16415e8e763d3864594 (patch) | |
| tree | 94653bc32de7371cbfdc909a7ac6b9d65caea9cc /packages/frontend/src/scripts | |
| parent | :art: (diff) | |
| download | sharkey-f15f60d5b948d4aff002f16415e8e763d3864594.tar.gz sharkey-f15f60d5b948d4aff002f16415e8e763d3864594.tar.bz2 sharkey-f15f60d5b948d4aff002f16415e8e763d3864594.zip | |
feat: 開発者モードを追加
Diffstat (limited to 'packages/frontend/src/scripts')
| -rw-r--r-- | packages/frontend/src/scripts/get-note-menu.ts | 12 | ||||
| -rw-r--r-- | packages/frontend/src/scripts/get-user-menu.ts | 12 |
2 files changed, 22 insertions, 2 deletions
diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index c8a6100253..960f26ca67 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -7,7 +7,7 @@ import { instance } from '@/instance'; import * as os from '@/os'; import copyToClipboard from '@/scripts/copy-to-clipboard'; import { url } from '@/config'; -import { noteActions } from '@/store'; +import { defaultStore, noteActions } from '@/store'; import { miLocalStorage } from '@/local-storage'; import { getUserMenu } from '@/scripts/get-user-menu'; import { clipsCache } from '@/cache'; @@ -396,5 +396,15 @@ export function getNoteMenu(props: { }))]); } + if (defaultStore.state.devMode) { + menu = menu.concat([null, { + icon: 'ti ti-id', + text: i18n.ts.copyNoteId, + action: () => { + copyToClipboard(appearNote.id); + }, + }]); + } + return menu; } diff --git a/packages/frontend/src/scripts/get-user-menu.ts b/packages/frontend/src/scripts/get-user-menu.ts index 6ff9fb63f1..b055d26473 100644 --- a/packages/frontend/src/scripts/get-user-menu.ts +++ b/packages/frontend/src/scripts/get-user-menu.ts @@ -4,7 +4,7 @@ import { i18n } from '@/i18n'; import copyToClipboard from '@/scripts/copy-to-clipboard'; import { host } from '@/config'; import * as os from '@/os'; -import { userActions } from '@/store'; +import { defaultStore, userActions } from '@/store'; import { $i, iAmModerator } from '@/account'; import { mainRouter } from '@/router'; import { Router } from '@/nirax'; @@ -240,6 +240,16 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router }]); } + if (defaultStore.state.devMode) { + menu = menu.concat([null, { + icon: 'ti ti-id', + text: i18n.ts.copyUserId, + action: () => { + copyToClipboard(user.id); + }, + }]); + } + if ($i && meId === user.id) { menu = menu.concat([null, { icon: 'ti ti-pencil', |