Skip to content

Commit 2638900

Browse files
committed
Hide 'Copy code' option when it is not available
1 parent 4ee4dbd commit 2638900

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

extension/src/command-palette/getCommands.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
/* global extLib, utils, sendMessageForGa */
22

33
import { getBrowser } from 'helpmate/dist/browser/getBrowser.js';
4-
import { copyToClipboard } from 'helpmate/dist/misc/copyToClipboard.js';
4+
import {
5+
isCopyToClipboardSupported,
6+
copyToClipboard
7+
} from 'helpmate/dist/misc/copyToClipboard.js';
58

69
import {
710
APP_$_OPEN_SEARCH_ICONS
@@ -182,6 +185,7 @@ const getCommands = async () => (
182185
},
183186

184187
{
188+
skip: isCopyToClipboardSupported() ? false : true,
185189
operationId: 'copy-code',
186190
name: 'Copy code',
187191
iconCls: 'magicss-use-icon-copy-gray',

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"crypto-js": "^4.1.1",
4444
"css-loader": "^6.7.2",
4545
"emmetio-codemirror-plugin-webextensions": "^0.3.7",
46-
"helpmate": "^1.1.2",
46+
"helpmate": "^1.1.3",
4747
"immer": "^9.0.16",
4848
"jquery": "^3.6.1",
4949
"mini-css-extract-plugin": "^2.7.0",

0 commit comments

Comments
 (0)