From 3f049216429972f03c773e4c5f038559e70a4f0c Mon Sep 17 00:00:00 2001
From: Chris Hines <chris.hines@monash.edu>
Date: Mon, 25 May 2020 17:21:33 +1000
Subject: [PATCH] fix for
 https://gitlab.erc.monash.edu.au/hpc-team/strudelv2_spa/-/issues/138

---
 src/app/launch-dialog/launch-dialog.component.ts | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/app/launch-dialog/launch-dialog.component.ts b/src/app/launch-dialog/launch-dialog.component.ts
index f186c31..56c09ca 100644
--- a/src/app/launch-dialog/launch-dialog.component.ts
+++ b/src/app/launch-dialog/launch-dialog.component.ts
@@ -43,6 +43,7 @@ export class LaunchDialogComponent implements OnInit {
   configtoggle: boolean;
   configwindow: any;
   public readyToLaunch: boolean;
+  private openWindowSub: Subscription;
 
   //constructor( public dialogRef: MatDialogRef<LaunchDialogComponent>,
   constructor( 
@@ -59,7 +60,6 @@ export class LaunchDialogComponent implements OnInit {
     this.height=0;
     this.submitcmd.subscribe(() => this.canILaunch());
     this.appData.subscribe(() => this.canILaunch());
-    this.tesService.openWindow$.subscribe((v) => {  this.browserWindowService.openAppWindow(v.job,v.url,v.usebasicauth,v.action,v.appinst)})
     this.browserWindowService.cancelJob$.subscribe((v) => this.tesService.cancel(v))
 
   }
@@ -69,6 +69,7 @@ export class LaunchDialogComponent implements OnInit {
     this.setFocus = false;
     this.updateURLs();
     this.clearInfo();
+    this.openWindowSub = this.tesService.openWindow$.subscribe((v) => {  this.browserWindowService.openAppWindow(v.job,v.url,v.usebasicauth,v.action,v.appinst)})
     this.subscriptions.push(this.appSubject.subscribe(() => { this.app = this.appSubject.value; this.updateURLs() ; this.clearInfo()}));
   }
 
@@ -109,6 +110,7 @@ export class LaunchDialogComponent implements OnInit {
     for (let s of this.subscriptions) {
       s.unsubscribe();
     }
+    this.openWindowSub.unsubscribe();
   }
 
 
-- 
GitLab