diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-05-21 07:31:24 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-21 07:31:24 +0900 |
| commit | 9480120eba1db238072b0bdfc9e6d01b2494cb3b (patch) | |
| tree | 3a4d7963e7dd9e540713d6f2b26fc98e2c586223 /packages/frontend/src/components/MkUserSetupDialog.Profile.vue | |
| parent | enhance(frontend): URLプレビューをユーザーサイドで無効化で... (diff) | |
| download | misskey-9480120eba1db238072b0bdfc9e6d01b2494cb3b.tar.gz misskey-9480120eba1db238072b0bdfc9e6d01b2494cb3b.tar.bz2 misskey-9480120eba1db238072b0bdfc9e6d01b2494cb3b.zip | |
Feat: ドライブ周りのUIの強化 (#16011)
* wip
* wip
* Update MkDrive.vue
* wip
* Update MkDrive.vue
* Update MkDrive.vue
* wip
* Update MkDrive.vue
* Update MkDrive.vue
* wip
* Update MkDrive.vue
* wip
* wip
* wip
* wip
* Update MkDrive.vue
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* feat(frontend): upload dialog (#16032)
* wip
* wip
* Update MkUploadDialog.vue
* wip
* wip
* wip
* wip
* wip
* Update MkUploadDialog.vue
* wip
* wip
* Update MkDrive.vue
* wip
* wip
* Update MkPostForm.vue
* wip
* Update room.form.vue
* Update os.ts
* wiop
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update select-file.ts
* wip
* wip
* Update MkDrive.vue
* Update drag-and-drop.ts
* wip
* wip
* wop
* wip
* wip
* Update MkDrive.vue
* Update CHANGELOG.md
* wipo
* Update MkDrive.folder.vue
* wip
* Update MkUploaderDialog.vue
* wip
* wip
* Update MkUploaderDialog.vue
* wip
* Update MkDrive.vue
* Update MkDrive.vue
* wip
* wip
Diffstat (limited to 'packages/frontend/src/components/MkUserSetupDialog.Profile.vue')
| -rw-r--r-- | packages/frontend/src/components/MkUserSetupDialog.Profile.vue | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/packages/frontend/src/components/MkUserSetupDialog.Profile.vue b/packages/frontend/src/components/MkUserSetupDialog.Profile.vue index 30925b854c..4e96eff82e 100644 --- a/packages/frontend/src/components/MkUserSetupDialog.Profile.vue +++ b/packages/frontend/src/components/MkUserSetupDialog.Profile.vue @@ -37,7 +37,6 @@ import MkInput from '@/components/MkInput.vue'; import MkTextarea from '@/components/MkTextarea.vue'; import FormSlot from '@/components/form/slot.vue'; import MkInfo from '@/components/MkInfo.vue'; -import { chooseFileFromPc } from '@/utility/select-file.js'; import * as os from '@/os.js'; import { ensureSignin } from '@/i.js'; @@ -49,7 +48,7 @@ const description = ref($i.description ?? ''); watch(name, () => { os.apiWithDialog('i/update', { // 空文字列をnullにしたいので??は使うな - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + name: name.value || null, }, undefined, { '0b3f9f6a-2f4d-4b1f-9fb4-49d3a2fd7191': { @@ -62,36 +61,37 @@ watch(name, () => { watch(description, () => { os.apiWithDialog('i/update', { // 空文字列をnullにしたいので??は使うな - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + description: description.value || null, }); }); -function setAvatar(ev) { - chooseFileFromPc(false).then(async (files) => { - const file = files[0]; +async function setAvatar(ev) { + const files = await os.chooseFileFromPc({ multiple: false }); + const file = files[0]; - let originalOrCropped = file; + let originalOrCropped = file; - const { canceled } = await os.confirm({ - type: 'question', - text: i18n.ts.cropImageAsk, - okText: i18n.ts.cropYes, - cancelText: i18n.ts.cropNo, + const { canceled } = await os.confirm({ + type: 'question', + text: i18n.ts.cropImageAsk, + okText: i18n.ts.cropYes, + cancelText: i18n.ts.cropNo, + }); + + if (!canceled) { + originalOrCropped = await os.cropImageFile(file, { + aspectRatio: 1, }); + } - if (!canceled) { - originalOrCropped = await os.cropImage(file, { - aspectRatio: 1, - }); - } + const driveFile = (await os.launchUploader([originalOrCropped], { multiple: false }))[0]; - const i = await os.apiWithDialog('i/update', { - avatarId: originalOrCropped.id, - }); - $i.avatarId = i.avatarId; - $i.avatarUrl = i.avatarUrl; + const i = await os.apiWithDialog('i/update', { + avatarId: driveFile.id, }); + $i.avatarId = i.avatarId; + $i.avatarUrl = i.avatarUrl; } </script> |