diff --git a/src/components/IdentitySection.vue b/src/components/IdentitySection.vue
index f9e9fc53..0ad5962c 100644
--- a/src/components/IdentitySection.vue
+++ b/src/components/IdentitySection.vue
@@ -50,14 +50,16 @@
tabindex="0"
@click="emitShowLargeIdenticonUrl"
/>
-
+ >
+
+
diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue
index c12a9e06..8fea0cab 100644
--- a/src/views/AccountViewView.vue
+++ b/src/views/AccountViewView.vue
@@ -1482,8 +1482,15 @@ export default class AccountViewView extends Vue {
async deleteImage(): Promise {
try {
+ // Extract the image ID from the full URL
+ const imageId = this.profileImageUrl?.split('/').pop();
+ if (!imageId) {
+ this.notify.error("Invalid image URL");
+ return;
+ }
+
const response = await this.axios.delete(
- this.apiServer + "/api/image/" + this.profileImageUrl,
+ this.apiServer + "/api/image/" + imageId,
{ headers: await getHeaders(this.activeDid) },
);
if (response.status === 204) {
@@ -1500,6 +1507,11 @@ export default class AccountViewView extends Vue {
} catch (error) {
if (isApiError(error) && error.response?.status === 404) {
// it already doesn't exist so we won't say anything to the user
+ // Clear the local reference since the image is gone
+ this.profileImageUrl = "";
+ await this.$saveSettings({
+ profileImageUrl: "",
+ });
} else {
this.notify.error(
ACCOUNT_VIEW_CONSTANTS.ERRORS.IMAGE_DELETE_ERROR,