Skip to content

Commit

Permalink
feat(drive): ファイルをフォルダに移動するメニューを実装
Browse files Browse the repository at this point in the history
  • Loading branch information
nafu-at committed Jul 28, 2024
1 parent ec4079c commit b89c2af
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/frontend/src/scripts/get-drive-file-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit b89c2af

Please sign in to comment.