mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-18 12:37:08 +01:00
Remove redundant openDocuments and unused subscription
This commit is contained in:
parent
0fa9d71da8
commit
66f7ae3773
1 changed files with 6 additions and 13 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { FormControl } from '@angular/forms';
|
import { FormControl } from '@angular/forms';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { from, Observable, Subscription } from 'rxjs';
|
import { from, Observable, Subscription } from 'rxjs';
|
||||||
|
|
@ -16,7 +16,7 @@ import { Meta } from '@angular/platform-browser';
|
||||||
templateUrl: './app-frame.component.html',
|
templateUrl: './app-frame.component.html',
|
||||||
styleUrls: ['./app-frame.component.scss']
|
styleUrls: ['./app-frame.component.scss']
|
||||||
})
|
})
|
||||||
export class AppFrameComponent implements OnInit, OnDestroy {
|
export class AppFrameComponent implements OnInit {
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
public router: Router,
|
public router: Router,
|
||||||
|
|
@ -39,9 +39,9 @@ export class AppFrameComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
searchField = new FormControl('')
|
searchField = new FormControl('')
|
||||||
|
|
||||||
openDocuments: PaperlessDocument[] = []
|
get openDocuments(): PaperlessDocument[] {
|
||||||
|
return this.openDocumentsService.getOpenDocuments()
|
||||||
openDocumentsSubscription: Subscription
|
}
|
||||||
|
|
||||||
searchAutoComplete = (text$: Observable<string>) =>
|
searchAutoComplete = (text$: Observable<string>) =>
|
||||||
text$.pipe(
|
text$.pipe(
|
||||||
|
|
@ -92,13 +92,6 @@ export class AppFrameComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.openDocuments = this.openDocumentsService.getOpenDocuments()
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnDestroy() {
|
|
||||||
if (this.openDocumentsSubscription) {
|
|
||||||
this.openDocumentsSubscription.unsubscribe()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get displayName() {
|
get displayName() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue