diff options
Diffstat (limited to 'client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts')
-rw-r--r-- | client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts b/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts index 2c0e45e20..8b7d64ed3 100644 --- a/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts +++ b/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser' | ||
3 | import { Notifier, ServerService } from '@app/core' | 2 | import { Notifier, ServerService } from '@app/core' |
4 | import { Account, VideoChannel } from '@app/shared/shared-main' | 3 | import { Account, VideoChannel } from '@app/shared/shared-main' |
5 | import { NgbPopover } from '@ng-bootstrap/ng-bootstrap' | 4 | import { NgbPopover } from '@ng-bootstrap/ng-bootstrap' |
6 | import { getBytes } from '@root-helpers/bytes' | 5 | import { getBytes } from '@root-helpers/bytes' |
6 | import { imageToDataURL } from '@root-helpers/images' | ||
7 | 7 | ||
8 | @Component({ | 8 | @Component({ |
9 | selector: 'my-actor-avatar-edit', | 9 | selector: 'my-actor-avatar-edit', |
@@ -30,10 +30,9 @@ export class ActorAvatarEditComponent implements OnInit { | |||
30 | maxAvatarSize = 0 | 30 | maxAvatarSize = 0 |
31 | avatarExtensions = '' | 31 | avatarExtensions = '' |
32 | 32 | ||
33 | preview: SafeResourceUrl | 33 | preview: string |
34 | 34 | ||
35 | constructor ( | 35 | constructor ( |
36 | private sanitizer: DomSanitizer, | ||
37 | private serverService: ServerService, | 36 | private serverService: ServerService, |
38 | private notifier: Notifier | 37 | private notifier: Notifier |
39 | ) { } | 38 | ) { } |
@@ -63,7 +62,7 @@ export class ActorAvatarEditComponent implements OnInit { | |||
63 | this.avatarChange.emit(formData) | 62 | this.avatarChange.emit(formData) |
64 | 63 | ||
65 | if (this.previewImage) { | 64 | if (this.previewImage) { |
66 | this.preview = this.sanitizer.bypassSecurityTrustResourceUrl(URL.createObjectURL(avatarfile)) | 65 | imageToDataURL(avatarfile).then(result => this.preview = result) |
67 | } | 66 | } |
68 | } | 67 | } |
69 | 68 | ||