diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2024-05-27 17:28:08 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-27 17:28:08 +0900 |
| commit | 579b88adc7d48a43ef443798f568eead1c8e9fa5 (patch) | |
| tree | 27322d181599711b8f7f35d26a1d6da046b6f63d /packages/frontend/src/scripts | |
| parent | Bump version to 2024.5.0-beta.3 (diff) | |
| parent | Quick action implement (#13878) (diff) | |
| download | misskey-579b88adc7d48a43ef443798f568eead1c8e9fa5.tar.gz misskey-579b88adc7d48a43ef443798f568eead1c8e9fa5.tar.bz2 misskey-579b88adc7d48a43ef443798f568eead1c8e9fa5.zip | |
Merge branch 'develop' into release/2024.5.0
Diffstat (limited to 'packages/frontend/src/scripts')
| -rw-r--r-- | packages/frontend/src/scripts/admin-lookup.ts (renamed from packages/frontend/src/scripts/lookup-user.ts) | 23 | ||||
| -rw-r--r-- | packages/frontend/src/scripts/get-note-menu.ts | 6 |
2 files changed, 25 insertions, 4 deletions
diff --git a/packages/frontend/src/scripts/lookup-user.ts b/packages/frontend/src/scripts/admin-lookup.ts index efc9132e75..1b57b853c9 100644 --- a/packages/frontend/src/scripts/lookup-user.ts +++ b/packages/frontend/src/scripts/admin-lookup.ts @@ -63,3 +63,26 @@ export async function lookupUserByEmail() { } } } + +export async function lookupFile() { + const { canceled, result: q } = await os.inputText({ + title: i18n.ts.fileIdOrUrl, + minLength: 1, + }); + if (canceled) return; + + const show = (file) => { + os.pageWindow(`/admin/file/${file.id}`); + }; + + misskeyApi('admin/drive/show-file', q.startsWith('http://') || q.startsWith('https://') ? { url: q.trim() } : { fileId: q.trim() }).then(file => { + show(file); + }).catch(err => { + if (err.code === 'NO_SUCH_FILE') { + os.alert({ + type: 'error', + text: i18n.ts.notFound, + }); + } + }); +} diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index e7c9a848e0..71ad299f50 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -16,7 +16,7 @@ import { url } from '@/config.js'; import { defaultStore, noteActions } from '@/store.js'; import { miLocalStorage } from '@/local-storage.js'; import { getUserMenu } from '@/scripts/get-user-menu.js'; -import { clipsCache } from '@/cache.js'; +import { clipsCache, favoritedChannelsCache } from '@/cache.js'; import { MenuItem } from '@/types/menu.js'; import MkRippleEffect from '@/components/MkRippleEffect.vue'; import { isSupportShare } from '@/scripts/navigator.js'; @@ -603,9 +603,7 @@ export function getRenoteMenu(props: { icon: 'ti ti-repeat', text: appearNote.channel ? i18n.ts.renoteToOtherChannel : i18n.ts.renoteToChannel, children: async () => { - const channels = await misskeyApi('channels/my-favorites', { - limit: 30, - }); + const channels = await favoritedChannelsCache.fetch(); return channels.filter((channel) => { if (!appearNote.channelId) return true; return channel.id !== appearNote.channelId; |