Skip to content

Commit 438e79d

Browse files
committed
Remove use of destroy$ subscription as the service is started and stopped for multiple connections.
1 parent 414a62d commit 438e79d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/app/vdi/services/clipboard.service.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export class ClipboardService {
77
private _canUseClipboard: boolean = true;
88
private _clipboardContent: string = null;
99
private _manager: VirtualDesktopManager
10-
private _destroy$: Subject<boolean> = new Subject<boolean>();
1110

1211
private _clipboardSubscription$: ReplaySubject<{ content: string, event: string }>;
1312

@@ -19,18 +18,15 @@ export class ClipboardService {
1918
this._manager = manager;
2019

2120
this._clipboardSubscription$ = this._manager.onRemoteClipboardData;
22-
this._clipboardSubscription$.pipe(
23-
takeUntil(this._destroy$),
24-
).subscribe(this.onClipboardData);
21+
this._clipboardSubscription$.subscribe(this.onClipboardData);
2522

2623
this._startClipboardReadTimer();
2724
}
2825
}
2926

3027
public stop(): void {
3128
if (this._manager) {
32-
this._destroy$.next(true);
33-
this._destroy$.unsubscribe();
29+
this._clipboardSubscription$.unsubscribe();
3430
this._canUseClipboard = false;
3531
this._manager = null;
3632
}

0 commit comments

Comments
 (0)