mirror of https://github.com/jetkvm/kvm.git
fix: keyboard_layout default config (en-US/en_US)
Use correct format in default config, and also correct code change from #512 Fixes: #632
This commit is contained in:
parent
ccba27cedd
commit
98d3b99c8b
|
@ -111,7 +111,7 @@ var defaultConfig = &Config{
|
||||||
ActiveExtension: "",
|
ActiveExtension: "",
|
||||||
KeyboardMacros: []KeyboardMacro{},
|
KeyboardMacros: []KeyboardMacro{},
|
||||||
DisplayRotation: "270",
|
DisplayRotation: "270",
|
||||||
KeyboardLayout: "en-US",
|
KeyboardLayout: "en_US",
|
||||||
DisplayMaxBrightness: 64,
|
DisplayMaxBrightness: 64,
|
||||||
DisplayDimAfterSec: 120, // 2 minutes
|
DisplayDimAfterSec: 120, // 2 minutes
|
||||||
DisplayOffAfterSec: 1800, // 30 minutes
|
DisplayOffAfterSec: 1800, // 30 minutes
|
||||||
|
|
|
@ -39,11 +39,11 @@ export default function PasteModal() {
|
||||||
state => state.setKeyboardLayout,
|
state => state.setKeyboardLayout,
|
||||||
);
|
);
|
||||||
|
|
||||||
// this ensures we always get the original en-US if it hasn't been set yet
|
// this ensures we always get the original en_US if it hasn't been set yet
|
||||||
const safeKeyboardLayout = useMemo(() => {
|
const safeKeyboardLayout = useMemo(() => {
|
||||||
if (keyboardLayout && keyboardLayout.length > 0)
|
if (keyboardLayout && keyboardLayout.length > 0)
|
||||||
return keyboardLayout;
|
return keyboardLayout;
|
||||||
return "en-US";
|
return "en_US";
|
||||||
}, [keyboardLayout]);
|
}, [keyboardLayout]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -25,11 +25,11 @@ export default function SettingsKeyboardRoute() {
|
||||||
state => state.setShowPressedKeys,
|
state => state.setShowPressedKeys,
|
||||||
);
|
);
|
||||||
|
|
||||||
// this ensures we always get the original en-US if it hasn't been set yet
|
// this ensures we always get the original en_US if it hasn't been set yet
|
||||||
const safeKeyboardLayout = useMemo(() => {
|
const safeKeyboardLayout = useMemo(() => {
|
||||||
if (keyboardLayout && keyboardLayout.length > 0)
|
if (keyboardLayout && keyboardLayout.length > 0)
|
||||||
return keyboardLayout;
|
return keyboardLayout;
|
||||||
return "en-US";
|
return "en_US";
|
||||||
}, [keyboardLayout]);
|
}, [keyboardLayout]);
|
||||||
|
|
||||||
const layoutOptions = Object.entries(layouts).map(([code, language]) => { return { value: code, label: language } })
|
const layoutOptions = Object.entries(layouts).map(([code, language]) => { return { value: code, label: language } })
|
||||||
|
|
Loading…
Reference in New Issue