mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-27 07:00:55 +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>
|
||||
</div>
|
||||
</a>
|
||||
<button mat-icon-button (click)="editSubscription(sub)">
|
||||
<mat-icon>edit</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button (click)="showSubInfo(sub)">
|
||||
<mat-icon>info</mat-icon>
|
||||
</button>
|
||||
|
||||
@@ -5,6 +5,7 @@ import { SubscribeDialogComponent } from 'app/dialogs/subscribe-dialog/subscribe
|
||||
import { PostsService } from 'app/posts.services';
|
||||
import { Router } from '@angular/router';
|
||||
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({
|
||||
selector: 'app-subscriptions',
|
||||
@@ -32,8 +33,8 @@ export class SubscriptionsComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getSubscriptions() {
|
||||
this.subscriptions_loading = true;
|
||||
getSubscriptions(show_loading = true) {
|
||||
if (show_loading) this.subscriptions_loading = true;
|
||||
this.subscriptions = null;
|
||||
this.postsService.getAllSubscriptions().subscribe(res => {
|
||||
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
|
||||
public openSnackBar(message: string, action = '') {
|
||||
this.snackBar.open(message, action, {
|
||||
|
||||
Reference in New Issue
Block a user