mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-03 07:00:53 +00:00
Main Menu UI Overhaul (#2829)
## Description: Overhauls the Main Menu UI, visit https://menu.openfront.dev to see everything. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: w.o.n
This commit is contained in:
@@ -176,13 +176,21 @@ export class InputHandler {
|
||||
saved = Object.fromEntries(
|
||||
Object.entries(parsed)
|
||||
.map(([k, v]) => {
|
||||
if (v && typeof v === "object" && "value" in (v as any)) {
|
||||
return [k, (v as any).value as string];
|
||||
// Extract value from nested object or plain string
|
||||
let val: unknown;
|
||||
if (v && typeof v === "object" && "value" in v) {
|
||||
val = (v as { value: unknown }).value;
|
||||
} else {
|
||||
val = v;
|
||||
}
|
||||
if (typeof v === "string") return [k, v];
|
||||
return [k, undefined];
|
||||
|
||||
// Map invalid values to undefined (filtered later)
|
||||
if (typeof val !== "string" || val === "Null") {
|
||||
return [k, undefined];
|
||||
}
|
||||
return [k, val];
|
||||
})
|
||||
.filter(([, v]) => typeof v === "string" && v !== "Null"),
|
||||
.filter(([, v]) => typeof v === "string"),
|
||||
) as Record<string, string>;
|
||||
} catch (e) {
|
||||
console.warn("Invalid keybinds JSON:", e);
|
||||
|
||||
Reference in New Issue
Block a user