From 6aab33c71b7b2f7b42bec57f28d055a81da28028 Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Mon, 23 Sep 2024 15:34:17 +0200 Subject: [PATCH] Fix clipboard (#4183) --- src/js/Clipboard.js | 4 ---- src/js/tabs/cli.js | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/js/Clipboard.js b/src/js/Clipboard.js index 66229d5099..36f448b289 100644 --- a/src/js/Clipboard.js +++ b/src/js/Clipboard.js @@ -1,9 +1,5 @@ // naming BFClipboard to avoid conflict with Clipboard API class BFClipboard { - constructor() { - this.writeText = null; - this.readText = null; - } writeText(text, onSuccess, onError) { navigator.clipboard .writeText(text) diff --git a/src/js/tabs/cli.js b/src/js/tabs/cli.js index a161c5e5e9..5c4b1d323d 100644 --- a/src/js/tabs/cli.js +++ b/src/js/tabs/cli.js @@ -1,5 +1,5 @@ import { i18n } from "../localization"; -import Clipboard from "../Clipboard"; +import BFClipboard from "../Clipboard"; import { generateFilename } from "../utils/generate_filename"; import GUI, { TABS } from '../gui'; import BuildApi from '../BuildApi'; @@ -89,7 +89,7 @@ function copyToClipboard(text) { console.warn(ex); } - Clipboard.writeText(text, onCopySuccessful, onCopyFailed); + BFClipboard.writeText(text, onCopySuccessful, onCopyFailed); } cli.initialize = function (callback) {