add temporary vification on profile picture

This commit is contained in:
Eudes Inácio
2023-10-26 13:28:54 +01:00
parent 25cd137917
commit 6a0fb91876
7 changed files with 46 additions and 37 deletions
+20 -17
View File
@@ -102,26 +102,29 @@ export class HeaderPage implements OnInit {
getProfilpicture() {
this.attachmentService.getUserProfilePhoto(this.SessionStore.user.UserPhoto).subscribe((base) => {
if(this.SessionStore.user.UserPhoto) {
this.attachmentService.getUserProfilePhoto(this.SessionStore.user.UserPhoto).subscribe((base) => {
this.storageService.store(this.SessionStore.user.RoleID.toString(), 'data:image/jpeg;base64,' + base).then((value) => {
this.profilePicture = 'data:image/jpeg;base64,' + base;
console.log('picture saved', value)
}).catch((error) => {
console.log('picture not saved')
});
}, (error) => {
console.log('profile picture errro: ', error)
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
console.log(picture)
this.profilePicture = picture
}).catch((error) => {
this.profilePicture = "";
this.storageService.store(this.SessionStore.user.RoleID.toString(), 'data:image/jpeg;base64,' + base).then((value) => {
this.profilePicture = 'data:image/jpeg;base64,' + base;
console.log('picture saved', value)
}).catch((error) => {
console.log('picture not saved')
});
}, (error) => {
console.log('profile picture errro: ', error)
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
console.log(picture)
this.profilePicture = picture
}).catch((error) => {
this.profilePicture = "";
})
})
})
} else {
this.profilePicture = "";
}
}