Skip to content

Commit

Permalink
Merge pull request #1154 from aeternity/feature/fix-user-info-preview
Browse files Browse the repository at this point in the history
fix(user-info): add initial profile, include loading stage
  • Loading branch information
CedrikNikita authored Sep 8, 2021
2 parents f7f5991 + ad8993d commit 46432be
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/components/UserInfo.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<template>
<Spinner
v-if="!profile"
class="user-info"
/>
<div
v-else
class="user-info"
>
<div class="user-info">
<div
class="profile-section"
:style="profile.coverImage
Expand Down Expand Up @@ -70,7 +63,7 @@
<ClientOnly>
<div class="location">
<img
v-if="profile.location.length || isOwn"
v-if="profile.location || isOwn"
src="../assets/location.svg"
>
<input
Expand Down Expand Up @@ -221,6 +214,9 @@
</div>
</div>
</div>
<Spinner
v-if="loading"
/>
</div>
</template>

Expand Down Expand Up @@ -256,9 +252,15 @@ export default {
data() {
return {
maxLength: 250,
loading: false,
userStats: null,
editMode: false,
profile: null,
profile: {
biography: '',
createdAt: '',
location: '',
coverImage: '',
},
balance: '',
BACKEND_URL: process.env.VUE_APP_BACKEND_URL,
};
Expand Down Expand Up @@ -327,7 +329,6 @@ export default {
() => this.reloadData(),
{ immediate: true },
);
this.reloadBalance();
EventBus.$on('reloadData', () => {
this.reloadData();
Expand Down Expand Up @@ -360,6 +361,7 @@ export default {
await this.resetEditedValues();
},
async reloadData() {
this.loading = true;
await Promise.all([
this.reloadProfile(),
Backend.getSenderStats(this.address).then((stats) => {
Expand All @@ -373,6 +375,7 @@ export default {
});
})(),
]);
this.loading = false;
},
async reloadProfile() {
this.profile = await Backend.getProfile(this.address);
Expand Down

0 comments on commit 46432be

Please sign in to comment.