Skip to content

Commit

Permalink
Default Profile Image on Remove Click (fixes #1460) (#1482)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirojdyola authored and paulbert committed Jun 28, 2018
1 parent 254c017 commit 79e49e1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/app/users/users-update/users-update.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ export class UsersUpdateComponent implements OnInit {
readonly dbName = '_users'; // make database name a constant
editForm: FormGroup;
currentImgKey: string;
currentProfileImg: string;
defaultProfileImg = 'assets/image.png';
currentProfileImg = 'assets/image.png';
previewSrc = 'assets/image.png';
uploadImage = false;
urlPrefix = environment.couchAddress + this.dbName + '/';
Expand Down Expand Up @@ -70,11 +69,9 @@ export class UsersUpdateComponent implements OnInit {
// If multiple attachments this could break? Entering the if-block as well
this.currentImgKey = Object.keys(data._attachments)[0];
this.currentProfileImg = this.urlPrefix + '/org.couchdb.user:' + this.urlName + '/' + this.currentImgKey;
this.previewSrc = this.currentProfileImg;
this.uploadImage = true;
} else {
this.previewSrc = this.defaultProfileImg;
}
this.previewSrc = this.currentProfileImg;
console.log('data: ' + data);
}, (error) => {
console.log(error);
Expand Down

0 comments on commit 79e49e1

Please sign in to comment.