mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-12 00:19:48 +00:00
Change: more clearly handle init permissions error (#7334)
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
} from '@angular/core'
|
||||
import { Meta } from '@angular/platform-browser'
|
||||
import { CookieService } from 'ngx-cookie-service'
|
||||
import { first, Observable, tap } from 'rxjs'
|
||||
import { catchError, first, Observable, of, tap } from 'rxjs'
|
||||
import {
|
||||
BRIGHTNESS,
|
||||
estimateBrightnessForColor,
|
||||
@@ -288,6 +288,19 @@ export class SettingsService {
|
||||
public initializeSettings(): Observable<UiSettings> {
|
||||
return this.http.get<UiSettings>(this.baseUrl).pipe(
|
||||
first(),
|
||||
catchError((error) => {
|
||||
setTimeout(() => {
|
||||
this.toastService.showError('Error loading settings', error)
|
||||
}, 500)
|
||||
return of({
|
||||
settings: {
|
||||
documentListSize: 10,
|
||||
update_checking: { backend_setting: 'default' },
|
||||
},
|
||||
user: {},
|
||||
permissions: [],
|
||||
})
|
||||
}),
|
||||
tap((uisettings) => {
|
||||
Object.assign(this.settings, uisettings.settings)
|
||||
if (this.get(SETTINGS_KEYS.APP_TITLE)?.length) {
|
||||
|
Reference in New Issue
Block a user