fix issues updating avatar (#870)

This commit is contained in:
slothful-vassal
2026-03-10 18:00:38 +01:00
committed by GitHub
parent c9acf8ad91
commit 4b1dc784c9
3 changed files with 65 additions and 12 deletions

View File

@@ -139,7 +139,17 @@ export async function users_update(user: User | { [K in keyof User]?: User[K] },
}
const model: User = await r.json();
currentUser.set(model);
const existing = get(currentUser);
const merged: User = {
...(existing ?? {}),
...model,
} as User;
if (!(merged as any).actor && (existing as any)?.actor) {
(merged as any).actor = (existing as any).actor;
}
currentUser.set(merged);
}
export async function users_delete(user: User) {
@@ -180,4 +190,4 @@ export async function users_confirm_reset(reset: { password: string, passwordCon
return await r.json();
}
}