Skip to content

Commit

Permalink
fix: アイコンデコレーション編集ページのファイル選択が機能していない問題を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
hideki0403 committed Nov 22, 2024
1 parent 04e86c0 commit fc52f54
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/frontend/src/pages/avatar-decoration-edit-dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkAvatar style="width: 60px; height: 60px;" :user="$i" :decorations="url != '' ? [{ url }] : []" forceShowDecoration/>
</div>
</div>
<MkButton rounded style="margin: 0 auto;" @click="selectImage(avatarDecoration, $event)">{{ i18n.ts.selectFile }}</MkButton>
<MkButton rounded style="margin: 0 auto;" @click="selectImage($event)">{{ i18n.ts.selectFile }}</MkButton>
<MkInput v-model="name">
<template #label>{{ i18n.ts.name }}</template>
</MkInput>
Expand Down Expand Up @@ -99,10 +99,10 @@ watch(roleIdsThatCanBeUsedThisDecoration, async () => {
rolesThatCanBeUsedThisDecoration.value = (await Promise.all(roleIdsThatCanBeUsedThisDecoration.value.map((id) => misskeyApi('admin/roles/show', { roleId: id }).catch(() => null)))).filter(x => x != null);
}, { immediate: true });

async function selectImage(decoration, ev) {
async function selectImage(ev) {
const file = await selectFile(ev.currentTarget ?? ev.target, null);
decoration.name = file.name.replace(/\.(.+)$/, '');
decoration.url = file.url;
name.value = file.name.replace(/\.(.+)$/, '');
url.value = file.url;
}

async function addRole() {
Expand Down

0 comments on commit fc52f54

Please sign in to comment.