Improved UX in share dialog and video info dialog

This commit is contained in:
Tzahi12345
2023-01-13 22:52:52 -05:00
parent cebf8c3d36
commit 6c8b7d0052
7 changed files with 10 additions and 5 deletions

View File

@@ -1,8 +1,8 @@
<h4 mat-dialog-title>
{{file.title}}
<div class="favorite-button">
<button mat-icon-button (click)="editing = !editing"><mat-icon>edit</mat-icon></button>
<button [disabled]="!initialized || retrieving_file" (click)="toggleFavorite()" mat-icon-button ><mat-icon>{{file.favorite ? 'favorite_filled' : 'favorite_outline'}}</mat-icon></button>
<button [disabled]="!initialized || retrieving_file || !write_access" mat-icon-button (click)="editing = !editing"><mat-icon>edit</mat-icon></button>
<button [disabled]="!initialized || retrieving_file || !write_access" (click)="toggleFavorite()" mat-icon-button ><mat-icon>{{file.favorite ? 'favorite_filled' : 'favorite_outline'}}</mat-icon></button>
</div>
</h4>

View File

@@ -20,6 +20,7 @@ export class VideoInfoDialogComponent implements OnInit {
editing = false;
initialized = false;
retrieving_file = false;
write_access = false;
constructor(@Inject(MAT_DIALOG_DATA) public data: any, public postsService: PostsService, private datePipe: DatePipe) { }
@@ -29,6 +30,7 @@ export class VideoInfoDialogComponent implements OnInit {
this.initializeFile(this.data.file);
}
this.postsService.reloadCategories();
this.write_access = !this.file.user_uid || (this.file.user_uid && this.postsService.user?.uid === this.file.user_uid);
}
initializeFile(file: DatabaseFile): void {