mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Remove redundant openDocuments and unused subscription
This commit is contained in:
		| @@ -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() { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon