mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-18 19:21:29 +03:00
Added button to edit a subscription from the subscriptions page
This commit is contained in:
@@ -14,6 +14,9 @@
|
|||||||
<ng-container i18n="Subscription playlist not available text">Name not available. Channel retrieval in progress.</ng-container>
|
<ng-container i18n="Subscription playlist not available text">Name not available. Channel retrieval in progress.</ng-container>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
<button mat-icon-button (click)="editSubscription(sub)">
|
||||||
|
<mat-icon>edit</mat-icon>
|
||||||
|
</button>
|
||||||
<button mat-icon-button (click)="showSubInfo(sub)">
|
<button mat-icon-button (click)="showSubInfo(sub)">
|
||||||
<mat-icon>info</mat-icon>
|
<mat-icon>info</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { SubscribeDialogComponent } from 'app/dialogs/subscribe-dialog/subscribe
|
|||||||
import { PostsService } from 'app/posts.services';
|
import { PostsService } from 'app/posts.services';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { SubscriptionInfoDialogComponent } from 'app/dialogs/subscription-info-dialog/subscription-info-dialog.component';
|
import { SubscriptionInfoDialogComponent } from 'app/dialogs/subscription-info-dialog/subscription-info-dialog.component';
|
||||||
|
import { EditSubscriptionDialogComponent } from 'app/dialogs/edit-subscription-dialog/edit-subscription-dialog.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-subscriptions',
|
selector: 'app-subscriptions',
|
||||||
@@ -32,8 +33,8 @@ export class SubscriptionsComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getSubscriptions() {
|
getSubscriptions(show_loading = true) {
|
||||||
this.subscriptions_loading = true;
|
if (show_loading) this.subscriptions_loading = true;
|
||||||
this.subscriptions = null;
|
this.subscriptions = null;
|
||||||
this.postsService.getAllSubscriptions().subscribe(res => {
|
this.postsService.getAllSubscriptions().subscribe(res => {
|
||||||
this.channel_subscriptions = [];
|
this.channel_subscriptions = [];
|
||||||
@@ -102,6 +103,17 @@ export class SubscriptionsComponent implements OnInit {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
editSubscription(sub) {
|
||||||
|
const dialogRef = this.dialog.open(EditSubscriptionDialogComponent, {
|
||||||
|
data: {
|
||||||
|
sub: this.postsService.getSubscriptionByID(sub.id)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialogRef.afterClosed().subscribe(() => {
|
||||||
|
this.getSubscriptions(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// snackbar helper
|
// snackbar helper
|
||||||
public openSnackBar(message: string, action = '') {
|
public openSnackBar(message: string, action = '') {
|
||||||
this.snackBar.open(message, action, {
|
this.snackBar.open(message, action, {
|
||||||
|
|||||||
Reference in New Issue
Block a user