From 128511cc8223898821b07e2d19992018af5c811a Mon Sep 17 00:00:00 2001
From: Xiao Gui <xgui3783@gmail.com>
Date: Thu, 31 Mar 2022 20:47:11 +0200
Subject: [PATCH] bugfix: fix dismiss voi

---
 src/viewerModule/viewerCmp/viewerCmp.component.ts | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/viewerModule/viewerCmp/viewerCmp.component.ts b/src/viewerModule/viewerCmp/viewerCmp.component.ts
index 2ac67737f..5afa255d5 100644
--- a/src/viewerModule/viewerCmp/viewerCmp.component.ts
+++ b/src/viewerModule/viewerCmp/viewerCmp.component.ts
@@ -1,3 +1,4 @@
+import { Subject } from "rxjs"
 import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ComponentFactory, ComponentFactoryResolver, Inject, Injector, Input, OnDestroy, Optional, TemplateRef, ViewChild, ViewContainerRef } from "@angular/core";
 import { select, Store } from "@ngrx/store";
 import { combineLatest, merge, NEVER, Observable, of, Subscription } from "rxjs";
@@ -198,6 +199,7 @@ export class ViewerCmp implements OnDestroy {
     distinctUntilChanged()
   )
 
+  private voiForceOff = new Subject()
   public pliVol$ = merge(
     this._pliVol$?.pipe(
       filter(arr => arr.length > 0),
@@ -216,7 +218,8 @@ export class ViewerCmp implements OnDestroy {
           ? [{ doi: this._1umLink }]
           : []
       }))
-    )
+    ),
+    this.voiForceOff
   )
 
   /**
@@ -256,6 +259,7 @@ export class ViewerCmp implements OnDestroy {
       })
     )
     this.routerSvc.setCustomRoute('x-voi', null)
+    this.voiForceOff.next(false)
   }
   constructor(
     private store$: Store<any>,
-- 
GitLab