From ec10e8ed5b903b0a4d7af5c4a1f03c5f2e89c6b1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 17 Feb 2020 11:47:47 +0100 Subject: Fix playlist cache error --- client/src/app/shared/video-playlist/video-playlist.service.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'client') diff --git a/client/src/app/shared/video-playlist/video-playlist.service.ts b/client/src/app/shared/video-playlist/video-playlist.service.ts index bae6f9e04..38d915c6b 100644 --- a/client/src/app/shared/video-playlist/video-playlist.service.ts +++ b/client/src/app/shared/video-playlist/video-playlist.service.ts @@ -141,6 +141,8 @@ export class VideoPlaylistService { return this.authHttp.post<{ videoPlaylist: { id: number } }>(VideoPlaylistService.BASE_VIDEO_PLAYLIST_URL, data) .pipe( tap(res => { + if (!this.myAccountPlaylistCache) return + this.myAccountPlaylistCache.total++ this.myAccountPlaylistCache.data.push({ @@ -161,6 +163,8 @@ export class VideoPlaylistService { .pipe( map(this.restExtractor.extractDataBool), tap(() => { + if (!this.myAccountPlaylistCache) return + const playlist = this.myAccountPlaylistCache.data.find(p => p.id === videoPlaylist.id) playlist.displayName = body.displayName @@ -175,6 +179,8 @@ export class VideoPlaylistService { .pipe( map(this.restExtractor.extractDataBool), tap(() => { + if (!this.myAccountPlaylistCache) return + this.myAccountPlaylistCache.total-- this.myAccountPlaylistCache.data = this.myAccountPlaylistCache.data .filter(p => p.id !== videoPlaylist.id) -- cgit v1.2.3 From 017fbe1855a9b3aea601595b10e62c681fbcdb17 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 17 Feb 2020 11:56:28 +0100 Subject: Fix instance get config --- client/src/app/core/server/server.service.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index cdcbcb528..3997ce6db 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts @@ -159,8 +159,11 @@ export class ServerService { if (!this.configObservable) { this.configObservable = this.http.get(ServerService.BASE_CONFIG_URL) .pipe( - tap(this.saveConfigLocally), - tap(() => this.configLoaded = true), + tap(config => this.saveConfigLocally(config)), + tap(config => { + this.config = config + this.configLoaded = true + }), tap(() => { if (this.configReset) { this.configReloaded.next() -- cgit v1.2.3