Ensure HeaderBar and Profile view use the same profile object so avatar gets synced

This commit is contained in:
Johannes Zellner
2025-07-16 18:32:06 +02:00
parent 5967907f86
commit b1752de36f
4 changed files with 29 additions and 27 deletions
+9 -4
View File
@@ -203,9 +203,16 @@ ProfileModel.onChange(ProfileModel.KEYS.AVATAR, (value) => {
profile.value.avatarUrl = value;
});
async function refreshProfile() {
const [error, result] = await profileModel.get();
if (error) return console.error(error);
profile.value = result;
}
provide('subscriptionRequiredDialog', subscriptionRequiredDialog);
provide('features', features);
provide('profile', profile);
provide('refreshProfile', refreshProfile);
onMounted(async () => {
let [error, result] = await provisionModel.status();
@@ -222,9 +229,7 @@ onMounted(async () => {
return;
}
[error, result] = await profileModel.get();
if (error) return console.error(error);
profile.value = result;
await refreshProfile();
// ensure language from profile if set
if (profile.value.language) await setLanguage(profile.value.language);
@@ -304,7 +309,7 @@ onMounted(async () => {
</SideBar>
<div style="flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; height: 100%;">
<Headerbar :config="config" :subscription="subscription" :profile="profile"/>
<Headerbar :config="config" :subscription="subscription"/>
<div style="display: flex; justify-content: center; overflow: auto; flex-grow: 1; padding: 0 6px; position: relative;">
<AppsView v-if="view === VIEWS.APPS" />