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

Commit568e677

Browse files
committed
Extract macOS check into var
1 parent13f1b59 commit568e677

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
@@ -149,6 +149,8 @@ const TerminalPage: FC = () => {
149149
}),
150150
);
151151

152+
constisMac=navigator.platform.match("Mac");
153+
152154
constcopySelection=()=>{
153155
constselection=terminal.getSelection();
154156
if(selection){
@@ -178,11 +180,7 @@ const TerminalPage: FC = () => {
178180
// Make ctrl+shift+c (command+shift+c on macOS) copy the selected text.
179181
// By default this usually launches the browser dev tools, but users
180182
// expect this keybinding to copy when in the context of the web terminal.
181-
if(
182-
(navigator.platform.match("Mac") ?ev.metaKey :ev.ctrlKey)&&
183-
ev.shiftKey&&
184-
ev.key==="C"
185-
){
183+
if((isMac ?ev.metaKey :ev.ctrlKey)&&ev.shiftKey&&ev.key==="C"){
186184
ev.preventDefault();
187185
if(ev.type==="keydown"){
188186
copySelection();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp