Skip to content

Commit

Permalink
Fix clipboard (betaflight#4183)
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis authored and demvlad committed Nov 14, 2024
1 parent 4561a27 commit 93498e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/js/Clipboard.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/js/tabs/cli.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -89,7 +89,7 @@ function copyToClipboard(text) {
console.warn(ex);
}

Clipboard.writeText(text, onCopySuccessful, onCopyFailed);
BFClipboard.writeText(text, onCopySuccessful, onCopyFailed);
}

cli.initialize = function (callback) {
Expand Down

0 comments on commit 93498e4

Please sign in to comment.