mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Cleanup subscriptions
This commit is contained in:
@@ -5,6 +5,7 @@ import { DocumentService } from './rest/document.service';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { ConfirmDialogComponent } from 'src/app/components/common/confirm-dialog/confirm-dialog.component';
|
||||
import { Observable, Subject, of } from 'rxjs';
|
||||
import { take } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -78,7 +79,7 @@ export class OpenDocumentsService {
|
||||
modal.componentInstance.message = $localize`Are you sure you want to close all documents?`
|
||||
modal.componentInstance.btnClass = "btn-warning"
|
||||
modal.componentInstance.btnCaption = $localize`Close documents`
|
||||
modal.componentInstance.confirmClicked.subscribe(() => {
|
||||
modal.componentInstance.confirmClicked.pipe(take(1)).subscribe(() => {
|
||||
modal.componentInstance.buttonsEnabled = false
|
||||
modal.close()
|
||||
this.openDocuments.splice(0, this.openDocuments.length)
|
||||
|
Reference in New Issue
Block a user