diff --git a/packages/frontend/src/pages/avatar-decorations.vue b/packages/frontend/src/pages/avatar-decorations.vue index a9378ea79d..180cee9107 100644 --- a/packages/frontend/src/pages/avatar-decorations.vue +++ b/packages/frontend/src/pages/avatar-decorations.vue @@ -19,9 +19,14 @@ SPDX-License-Identifier: AGPL-3.0-only - - - +
+

{{ i18n.ts.image }}

+ {{ i18n.ts.selectFile }} +
+
+ + +
{{ i18n.ts.save }} {{ i18n.ts.delete }} @@ -45,9 +50,17 @@ import * as os from '@/os.js'; import { i18n } from '@/i18n.js'; import { definePageMetadata } from '@/scripts/page-metadata.js'; import MkFolder from '@/components/MkFolder.vue'; +import { selectFile } from '@/scripts/select-file.js'; let avatarDecorations: any[] = $ref([]); +async function changeImage(ev, avatarDecoration) { + const file = await selectFile(ev.currentTarget ?? ev.target, null); + if (file != null) { + avatarDecoration.url = file.url; + } +} + function add() { avatarDecorations.unshift({ _id: Math.random().toString(36), @@ -100,3 +113,37 @@ definePageMetadata({ icon: 'ti ti-sparkles', }); + +