Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit302b791

Browse files
committed
Extract macOS check into var
1 parentd62b41e commit302b791

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

‎site/src/pages/TerminalPage/TerminalPage.tsx‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ const TerminalPage: FC = () => {
148148
}),
149149
);
150150

151+
constisMac=navigator.platform.match("Mac");
152+
151153
constcopySelection=()=>{
152154
constselection=terminal.getSelection();
153155
if(selection){
@@ -183,11 +185,7 @@ const TerminalPage: FC = () => {
183185
// Make ctrl+shift+c (command+shift+c on macOS) copy the selected text.
184186
// By default this usually launches the browser dev tools, but users
185187
// expect this keybinding to copy when in the context of the web terminal.
186-
if(
187-
(navigator.platform.match("Mac") ?ev.metaKey :ev.ctrlKey)&&
188-
ev.shiftKey&&
189-
ev.key==="C"
190-
){
188+
if((isMac ?ev.metaKey :ev.ctrlKey)&&ev.shiftKey&&ev.key==="C"){
191189
ev.preventDefault();
192190
if(ev.type==="keydown"){
193191
copySelection();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp