diff --git a/src/client/app/desktop/api/update-avatar.ts b/src/client/app/desktop/api/update-avatar.ts index e2da55fc9..a095491b6 100644 --- a/src/client/app/desktop/api/update-avatar.ts +++ b/src/client/app/desktop/api/update-avatar.ts @@ -91,6 +91,7 @@ export default ($root: any) => { ? Promise.resolve(file) : $root.$chooseDriveFile({ multiple: false, + type: 'image/*', title: locale['desktop']['choose-avatar'] }); diff --git a/src/client/app/desktop/api/update-banner.ts b/src/client/app/desktop/api/update-banner.ts index e62277338..c23a32536 100644 --- a/src/client/app/desktop/api/update-banner.ts +++ b/src/client/app/desktop/api/update-banner.ts @@ -91,6 +91,7 @@ export default ($root: any) => { ? Promise.resolve(file) : $root.$chooseDriveFile({ multiple: false, + type: 'image/*', title: locale['desktop']['choose-banner'] }); diff --git a/src/client/app/desktop/script.ts b/src/client/app/desktop/script.ts index ce0b96e0a..806524171 100644 --- a/src/client/app/desktop/script.ts +++ b/src/client/app/desktop/script.ts @@ -77,6 +77,7 @@ init(async (launch, os) => { if (document.body.clientWidth > 800) { const w = this.$root.new(MkChooseFileFromDriveWindow, { title: o.title, + type: o.type, multiple: o.multiple, initFolder: o.currentFolder }); diff --git a/src/client/app/desktop/views/components/choose-file-from-drive-window.vue b/src/client/app/desktop/views/components/choose-file-from-drive-window.vue index 8b39e6e00..71c430ede 100644 --- a/src/client/app/desktop/views/components/choose-file-from-drive-window.vue +++ b/src/client/app/desktop/views/components/choose-file-from-drive-window.vue @@ -11,6 +11,7 @@ import('./drive.vue').then(m => m.default), }, props: { + type: { + type: String, + required: false, + default: undefined + }, multiple: { default: false } diff --git a/src/client/app/desktop/views/components/drive.vue b/src/client/app/desktop/views/components/drive.vue index 4b64d4f22..2eb958135 100644 --- a/src/client/app/desktop/views/components/drive.vue +++ b/src/client/app/desktop/views/components/drive.vue @@ -80,6 +80,11 @@ export default Vue.extend({ type: Object, required: false }, + type: { + type: String, + required: false, + default: undefined + }, multiple: { type: Boolean, default: false @@ -540,6 +545,7 @@ export default Vue.extend({ // ファイル一覧取得 this.$root.api('drive/files', { folderId: this.folder ? this.folder.id : null, + type: this.type, limit: filesMax + 1 }).then(files => { if (files.length == filesMax + 1) { @@ -570,6 +576,7 @@ export default Vue.extend({ // ファイル一覧取得 this.$root.api('drive/files', { folderId: this.folder ? this.folder.id : null, + type: this.type, untilId: this.files[this.files.length - 1].id, limit: max + 1 }).then(files => { diff --git a/src/client/app/mobile/views/components/drive-file-chooser.vue b/src/client/app/mobile/views/components/drive-file-chooser.vue index b72c796c1..8795102f9 100644 --- a/src/client/app/mobile/views/components/drive-file-chooser.vue +++ b/src/client/app/mobile/views/components/drive-file-chooser.vue @@ -8,6 +8,7 @@ import('./drive.vue').then(m => m.default), }, - props: ['multiple'], + props: ['type', 'multiple'], data() { return { files: []