Enable clearing of user avatar

This commit is contained in:
Johannes Zellner
2025-07-16 18:56:00 +02:00
parent b1752de36f
commit 696632e551
2 changed files with 19 additions and 1 deletions
+6 -1
View File
@@ -80,6 +80,11 @@ async function onAvatarSubmit(file) {
await refreshProfile();
}
async function onAvatarUnset() {
await profileModel.unsetAvatar();
await refreshProfile();
}
async function onPasswordChange() {
passwordChangeDialog.value.open();
}
@@ -211,7 +216,7 @@ onMounted(async () => {
<div style="display: flex; flex-wrap: wrap; gap: 20px">
<div style="width: 128px;">
<ImagePicker :src="profile.avatarUrl" fallback-src="/img/avatar-default-symbolic.svg" :disabled="config.profileLocked" :size="512" :save-handler="onAvatarSubmit" display-width="128px"/>
<ImagePicker :src="profile.avatarUrl" fallback-src="/img/avatar-default-symbolic.svg" :disabled="config.profileLocked" :size="512" :unset-handler="onAvatarUnset" :save-handler="onAvatarSubmit" display-width="128px"/>
</div>
<div style="flex-grow: 1;">
<SettingsItem>