Commits
Yura Bondarenko authored 485cc2bd31d
221 221 | this.distinctNext(this.isRouteLoading$, false); |
222 222 | } else if (event instanceof NavigationCancel) { |
223 223 | if (!updatingTheme) { |
224 224 | this.distinctNext(this.isThemeLoading$, false); |
225 225 | } |
226 226 | this.distinctNext(this.isRouteLoading$, false); |
227 227 | } |
228 228 | }); |
229 229 | } |
230 230 | |
231 + | /** |
232 + | * Update the theme according to the current route, if applicable. |
233 + | * @param urlAfterRedirects the current URL after redirects |
234 + | * @param snapshot the current route snapshot |
235 + | * @private |
236 + | */ |
231 237 | private updateTheme(urlAfterRedirects: string, snapshot: ActivatedRouteSnapshot): void { |
232 238 | this.themeService.updateThemeOnRouteChange$(urlAfterRedirects, snapshot).pipe( |
233 239 | switchMap((changed) => { |
234 240 | if (changed) { |
235 241 | return this.isThemeCSSLoading$; |
236 242 | } else { |
237 243 | return [false]; |
238 244 | } |
239 245 | }) |
240 246 | ).subscribe((changed) => { |