From b89c2af6945c6a9f9f10e83f54d2bcf0f240b0b4 Mon Sep 17 00:00:00 2001 From: nafu-at Date: Mon, 29 Jul 2024 01:27:12 +0900 Subject: [PATCH] =?UTF-8?q?feat(drive):=20=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=82=92=E3=83=95=E3=82=A9=E3=83=AB=E3=83=80=E3=81=AB?= =?UTF-8?q?=E7=A7=BB=E5=8B=95=E3=81=99=E3=82=8B=E3=83=A1=E3=83=8B=E3=83=A5?= =?UTF-8?q?=E3=83=BC=E3=82=92=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/scripts/get-drive-file-menu.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/frontend/src/scripts/get-drive-file-menu.ts b/packages/frontend/src/scripts/get-drive-file-menu.ts index c60f04fb4c46..fb6d70827df0 100644 --- a/packages/frontend/src/scripts/get-drive-file-menu.ts +++ b/packages/frontend/src/scripts/get-drive-file-menu.ts @@ -40,6 +40,15 @@ function describe(file: Misskey.entities.DriveFile) { }, 'closed'); } +function move(file: Misskey.entities.DriveFile) { + os.selectDriveFolder(false).then(folder => { + misskeyApi('drive/files/update', { + fileId: file.id, + folderId: folder[0] ? folder[0].id : null, + }); + }); +} + function toggleSensitive(file: Misskey.entities.DriveFile) { misskeyApi('drive/files/update', { fileId: file.id, @@ -100,6 +109,10 @@ export function getDriveFileMenu(file: Misskey.entities.DriveFile, folder?: Miss text: i18n.ts.rename, icon: 'ti ti-forms', action: () => rename(file), + }, { + text: i18n.ts.move, + icon: 'ti ti-folder-symlink', + action: () => move(file), }, { text: file.isSensitive ? i18n.ts.unmarkAsSensitive : i18n.ts.markAsSensitive, icon: file.isSensitive ? 'ti ti-eye' : 'ti ti-eye-exclamation',