mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-12 21:35:40 -05:00
Fix: saved view sidebar heading not always visible (#7584)
This commit is contained in:
@@ -3,7 +3,6 @@ import { Injectable } from '@angular/core'
|
||||
import { combineLatest, Observable } from 'rxjs'
|
||||
import { tap } from 'rxjs/operators'
|
||||
import { SavedView } from 'src/app/data/saved-view'
|
||||
import { PermissionsService } from '../permissions.service'
|
||||
import { AbstractPaperlessService } from './abstract-paperless-service'
|
||||
import { SettingsService } from '../settings.service'
|
||||
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
|
||||
@@ -12,11 +11,11 @@ import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class SavedViewService extends AbstractPaperlessService<SavedView> {
|
||||
loading: boolean
|
||||
public loading: boolean = true
|
||||
private savedViews: SavedView[] = []
|
||||
|
||||
constructor(
|
||||
http: HttpClient,
|
||||
permissionService: PermissionsService,
|
||||
protected http: HttpClient,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
super(http, 'saved_views')
|
||||
@@ -27,16 +26,19 @@ export class SavedViewService extends AbstractPaperlessService<SavedView> {
|
||||
}
|
||||
|
||||
private reload() {
|
||||
this.loading = true
|
||||
this.listAll().subscribe((r) => {
|
||||
this.savedViews = r.results
|
||||
this.loading = false
|
||||
this.settingsService.dashboardIsEmpty = this.dashboardViews.length === 0
|
||||
this.listAll().subscribe({
|
||||
next: (r) => {
|
||||
this.savedViews = r.results
|
||||
this.loading = false
|
||||
this.settingsService.dashboardIsEmpty = this.dashboardViews.length === 0
|
||||
},
|
||||
error: () => {
|
||||
this.loading = false
|
||||
this.settingsService.dashboardIsEmpty = true
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
private savedViews: SavedView[] = []
|
||||
|
||||
get allViews() {
|
||||
return this.savedViews
|
||||
}
|
||||
|
Reference in New Issue
Block a user