Add avatar to people page

This commit is contained in:
rotimi-best
2021-09-11 22:15:15 +03:00
parent 07eba6b4e0
commit 4a7843b0b4
3 changed files with 28 additions and 9 deletions
+10 -1
View File
@@ -74,6 +74,7 @@
.getPublicUrl(filename);
updates.avatar_url = publicURL;
currentProfile.avatar_url = publicURL;
}
avatar = undefined;
}
@@ -104,8 +105,16 @@
}
}
$: isDirty =
avatar ||
initialValueOfUserName !== currentProfile.username ||
initialValueOfFullName !== currentProfile.fullname;
$: isOwner = $profile.id === profileId;
$: getProfile(profileId);
$: if (avatar) {
updateProfile();
}
</script>
<svelte:head>
@@ -149,7 +158,7 @@
isDisabled={true}
/>
{#if avatar || initialValueOfUserName !== currentProfile.username || initialValueOfFullName !== currentProfile.fullname}
{#if isDirty}
<PrimaryButton
label={loading ? 'Updating...' : 'Update profile'}
onClick={updateProfile}