Change: more clearly handle init permissions error (#7334)

This commit is contained in:
shamoon
2024-07-28 07:06:15 -07:00
committed by GitHub
parent 45002f8083
commit dcfc53b7f2
4 changed files with 34 additions and 6 deletions

View File

@@ -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) {