From 6dd2579d01d61f093d258ad69978df0fc27aa184 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Mon, 15 Jul 2019 09:28:52 +0200 Subject: [PATCH] GH-5706: DIsposed the clipboard copy listener. Closes #5706. Signed-off-by: Akos Kitta --- .../filesystem/src/browser/download/file-download-service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/filesystem/src/browser/download/file-download-service.ts b/packages/filesystem/src/browser/download/file-download-service.ts index c6c594a611209..c146dc0110767 100644 --- a/packages/filesystem/src/browser/download/file-download-service.ts +++ b/packages/filesystem/src/browser/download/file-download-service.ts @@ -79,7 +79,10 @@ export class FileDownloadService { const downloadUrl = `${this.endpoint()}/download/?id=${jsonResponse.id}`; if (copyLink) { if (document.documentElement) { - addClipboardListener(document.documentElement, 'copy', e => this.handleCopy(e, downloadUrl)); + const toDispose = addClipboardListener(document.documentElement, 'copy', e => { + toDispose.dispose(); + this.handleCopy(e, downloadUrl); + }); document.execCommand('copy'); } } else {