Subscriptions now support multi-user-mode

Fixed bug where playlist subscription downloads would fail due to a mislabeled parameter

Components that are routes now make sure auth is finished before sending requests to the backend
This commit is contained in:
Tzahi12345
2020-04-30 04:54:41 -04:00
parent 0fb00bac12
commit 31f581c642
8 changed files with 207 additions and 96 deletions

View File

@@ -22,16 +22,23 @@ export class SubscriptionsComponent implements OnInit {
constructor(private dialog: MatDialog, public postsService: PostsService, private router: Router, private snackBar: MatSnackBar) { }
ngOnInit() {
this.getSubscriptions();
if (this.postsService.config) {
this.getSubscriptions();
}
this.postsService.config_reloaded.subscribe(changed => {
if (changed) {
this.getSubscriptions();
}
});
}
getSubscriptions() {
this.subscriptions_loading = true;
this.subscriptions = null;
this.channel_subscriptions = [];
this.playlist_subscriptions = [];
this.postsService.getAllSubscriptions().subscribe(res => {
this.subscriptions_loading = false;
this.channel_subscriptions = [];
this.playlist_subscriptions = [];
this.subscriptions_loading = false;
this.subscriptions = res['subscriptions'];
if (!this.subscriptions) {
// set it to an empty array so it can notify the user there are no subscriptions