forked from XiaoMo/ChatGPT-Next-Web
[FIXED] now the default key should be CMD on MacOS
This commit is contained in:
parent
3bfcdf9c41
commit
f3d5fc7a84
@ -1,4 +1,5 @@
|
|||||||
import { LLMModel } from "../client/api";
|
import { LLMModel } from "../client/api";
|
||||||
|
import { isMacOS } from "../utils";
|
||||||
import { getClientConfig } from "../config/client";
|
import { getClientConfig } from "../config/client";
|
||||||
import {
|
import {
|
||||||
DEFAULT_INPUT_TEMPLATE,
|
DEFAULT_INPUT_TEMPLATE,
|
||||||
@ -27,7 +28,7 @@ export enum Theme {
|
|||||||
export const DEFAULT_CONFIG = {
|
export const DEFAULT_CONFIG = {
|
||||||
lastUpdate: Date.now(), // timestamp, to merge state
|
lastUpdate: Date.now(), // timestamp, to merge state
|
||||||
|
|
||||||
submitKey: SubmitKey.CtrlEnter as SubmitKey,
|
submitKey: isMacOS() ? SubmitKey.MetaEnter : SubmitKey.CtrlEnter,
|
||||||
avatar: "1f603",
|
avatar: "1f603",
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
theme: Theme.Auto as Theme,
|
theme: Theme.Auto as Theme,
|
||||||
|
10
app/utils.ts
10
app/utils.ts
@ -178,10 +178,10 @@ export function getCSSVar(varName: string) {
|
|||||||
* Detects if the Operation system is MacOS
|
* Detects if the Operation system is MacOS
|
||||||
*/
|
*/
|
||||||
export function isMacOS(): boolean {
|
export function isMacOS(): boolean {
|
||||||
if (window !== 'undefined') {
|
if (typeof window !== "undefined") {
|
||||||
let userAgent = window?.navigator?.userAgent
|
let userAgent = window?.navigator?.userAgent;
|
||||||
if (userAgent.indexOf('Mac') != -1) return true
|
if (userAgent.indexOf("Mac") != -1) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user