Ensure HeaderBar and Profile view use the same profile object so avatar gets synced
This commit is contained in:
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user