mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	tap ui settings get to avoid dup
This commit is contained in:
		| @@ -87,7 +87,6 @@ import localeSr from '@angular/common/locales/sr' | ||||
| import localeSv from '@angular/common/locales/sv' | ||||
| import localeTr from '@angular/common/locales/tr' | ||||
| import localeZh from '@angular/common/locales/zh' | ||||
| import { Observable } from 'rxjs' | ||||
| import { SettingsService } from './services/settings.service' | ||||
|  | ||||
| registerLocaleData(localeBe) | ||||
|   | ||||
| @@ -10,7 +10,7 @@ import { | ||||
| } from '@angular/core' | ||||
| import { Meta } from '@angular/platform-browser' | ||||
| import { CookieService } from 'ngx-cookie-service' | ||||
| import { first, Observable } from 'rxjs' | ||||
| import { first, Observable, tap } from 'rxjs' | ||||
| import { | ||||
|   BRIGHTNESS, | ||||
|   estimateBrightnessForColor, | ||||
| @@ -60,13 +60,14 @@ export class SettingsService { | ||||
|  | ||||
|   // this is called by the app initializer in app.module | ||||
|   public initializeSettings(): Observable<PaperlessUiSettings> { | ||||
|     let settings$ = this.http.get<PaperlessUiSettings>(this.baseUrl) | ||||
|     settings$.pipe(first()).subscribe((uisettings) => { | ||||
|       Object.assign(this.settings, uisettings.settings) | ||||
|       this.maybeMigrateSettings() | ||||
|       this.displayName = uisettings.display_name.trim() | ||||
|     }) | ||||
|     return settings$ | ||||
|     return this.http.get<PaperlessUiSettings>(this.baseUrl).pipe( | ||||
|       first(), | ||||
|       tap((uisettings) => { | ||||
|         Object.assign(this.settings, uisettings.settings) | ||||
|         this.maybeMigrateSettings() | ||||
|         this.displayName = uisettings.display_name.trim() | ||||
|       }) | ||||
|     ) | ||||
|   } | ||||
|  | ||||
|   public updateAppearanceSettings( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon