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