mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-11 07:21:29 +03:00
Subscriptions are now reloaded on subscribe/unsubscribe in PostsService
This commit is contained in:
@@ -89,9 +89,7 @@ export class AppComponent implements OnInit {
|
|||||||
|
|
||||||
// gets the subscriptions
|
// gets the subscriptions
|
||||||
if (this.allowSubscriptions) {
|
if (this.allowSubscriptions) {
|
||||||
this.postsService.getAllSubscriptions().subscribe(res => {
|
this.postsService.reloadSubscriptions();
|
||||||
this.postsService.subscriptions = res['subscriptions'];
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -458,6 +458,12 @@ export class PostsService implements CanActivate {
|
|||||||
this.config_reloaded.next(true);
|
this.config_reloaded.next(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reloadSubscriptions() {
|
||||||
|
this.getAllSubscriptions().subscribe(res => {
|
||||||
|
this.subscriptions = res['subscriptions'];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
adminExists() {
|
adminExists() {
|
||||||
return this.http.post(this.path + 'auth/adminExists', {}, this.httpOptions);
|
return this.http.post(this.path + 'auth/adminExists', {}, this.httpOptions);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ export class SubscriptionsComponent implements OnInit {
|
|||||||
} else {
|
} else {
|
||||||
this.channel_subscriptions.push(result);
|
this.channel_subscriptions.push(result);
|
||||||
}
|
}
|
||||||
|
this.postsService.reloadSubscriptions();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -96,6 +97,7 @@ export class SubscriptionsComponent implements OnInit {
|
|||||||
if (success) {
|
if (success) {
|
||||||
this.openSnackBar(`${sub.name} successfully deleted!`)
|
this.openSnackBar(`${sub.name} successfully deleted!`)
|
||||||
this.getSubscriptions();
|
this.getSubscriptions();
|
||||||
|
this.postsService.reloadSubscriptions();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user