mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-05 11:31:29 +03:00
UI updates to subscriptions
Improved translation coverage
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { PostsService } from 'app/posts.services';
|
||||
import { ConfirmDialogComponent } from '../confirm-dialog/confirm-dialog.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-subscription-info-dialog',
|
||||
@@ -13,7 +14,8 @@ export class SubscriptionInfoDialogComponent implements OnInit {
|
||||
unsubbedEmitter = null;
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<SubscriptionInfoDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any, private postsService: PostsService) { }
|
||||
@Inject(MAT_DIALOG_DATA) public data: any, private postsService: PostsService,
|
||||
private dialog: MatDialog) { }
|
||||
|
||||
ngOnInit() {
|
||||
if (this.data) {
|
||||
@@ -22,6 +24,22 @@ export class SubscriptionInfoDialogComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
confirmUnsubscribe() {
|
||||
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
|
||||
data: {
|
||||
dialogTitle: $localize`Unsubscribe from ${this.sub['name']}:subscription name:`,
|
||||
dialogText: $localize`Would you like to unsubscribe from ${this.sub['name']}:subscription name:?`,
|
||||
submitText: $localize`Unsubscribe`,
|
||||
warnSubmitColor: true
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().subscribe(confirmed => {
|
||||
if (confirmed) {
|
||||
this.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
unsubscribe() {
|
||||
this.postsService.unsubscribe(this.sub, true).subscribe(res => {
|
||||
this.unsubbedEmitter.emit(true);
|
||||
@@ -30,7 +48,7 @@ export class SubscriptionInfoDialogComponent implements OnInit {
|
||||
}
|
||||
|
||||
downloadArchive() {
|
||||
this.postsService.downloadArchive(this.sub).subscribe(res => {
|
||||
this.postsService.downloadArchive(null, this.sub.id).subscribe(res => {
|
||||
const blob: Blob = res;
|
||||
saveAs(blob, 'archive.txt');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user