mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Profile picture, notifications, chat romms
This commit is contained in:
@@ -39,8 +39,8 @@ export class EditProfilePage implements OnInit {
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.getProfilpictureFromStorage();
|
||||
|
||||
this.getProfilpictureFromStorage();
|
||||
}
|
||||
getProfilpictureFromStorage() {
|
||||
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
|
||||
@@ -50,27 +50,27 @@ export class EditProfilePage implements OnInit {
|
||||
this.profilePicture = "";
|
||||
})
|
||||
}
|
||||
/* getProfilpicture(guid) {
|
||||
console.log('Get picture ', guid.path)
|
||||
this.attachmentService.getUserProfilePhoto().subscribe(async (picture: any) => {
|
||||
|
||||
console.log('Get picture ', picture)
|
||||
this.storageService.store(this.SessionStore.user.RoleID.toString() + "guid", guid.path)
|
||||
this.storageService.store(this.SessionStore.user.RoleID.toString(), picture).then((value) => {
|
||||
this.profilePicture = picture
|
||||
this.SessionStore.user.UserPhoto = picture;
|
||||
|
||||
|
||||
console.log('picture saved')
|
||||
}).catch((error) => {
|
||||
console.log('picture not saved')
|
||||
});
|
||||
|
||||
}, ((error) => {
|
||||
console.log('Error get profile picture: ', error)
|
||||
}))
|
||||
|
||||
} */
|
||||
/* getProfilpicture(guid) {
|
||||
console.log('Get picture ', guid.path)
|
||||
this.attachmentService.getUserProfilePhoto().subscribe(async (picture: any) => {
|
||||
|
||||
console.log('Get picture ', picture)
|
||||
this.storageService.store(this.SessionStore.user.RoleID.toString() + "guid", guid.path)
|
||||
this.storageService.store(this.SessionStore.user.RoleID.toString(), picture).then((value) => {
|
||||
this.profilePicture = picture
|
||||
this.SessionStore.user.UserPhoto = picture;
|
||||
|
||||
|
||||
console.log('picture saved')
|
||||
}).catch((error) => {
|
||||
console.log('picture not saved')
|
||||
});
|
||||
|
||||
}, ((error) => {
|
||||
console.log('Error get profile picture: ', error)
|
||||
}))
|
||||
|
||||
} */
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
@@ -188,14 +188,23 @@ export class EditProfilePage implements OnInit {
|
||||
this.attachmentService.addUserProfilePhoto(object).subscribe((guid) => {
|
||||
console.log('GUID ', guid)
|
||||
console.log(this.SessionStore.user.RoleID.toString())
|
||||
this.storageService.store(this.SessionStore.user.RoleID.toString(), this.capturedImage).then((value) => {
|
||||
this.profilePicture = 'data:image/jpeg;base64,' +this.capturedImage;
|
||||
|
||||
//get user profile picture base64
|
||||
this.attachmentService.getUserProfilePhoto(guid).subscribe((base) => {
|
||||
console.log('before picture saved',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')
|
||||
}).catch((error) => {
|
||||
console.log('picture not saved')
|
||||
});
|
||||
console.log('picture saved',value)
|
||||
}).catch((error) => {
|
||||
console.log('picture not saved')
|
||||
});
|
||||
|
||||
},(error) => {
|
||||
console.log('profile picture erro: ', error)
|
||||
})
|
||||
|
||||
/* this.getProfilpicture(guid); */
|
||||
}, ((error) => {
|
||||
console.log('Erro Upload profile picture ', error)
|
||||
|
||||
@@ -94,7 +94,7 @@ export class ProfilePage implements OnInit {
|
||||
getProfilpicture() {
|
||||
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
|
||||
console.log(picture)
|
||||
this.profilePicture = 'data:image/jpeg;base64,' +picture
|
||||
this.profilePicture = picture
|
||||
}).catch((error ) => {
|
||||
this.profilePicture = "";
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user