From 9b22d084d0e2906357d460f90e687224a339df50 Mon Sep 17 00:00:00 2001 From: Justin Silvestre Date: Thu, 12 Sep 2024 15:08:18 +0200 Subject: [PATCH] Use Hanyu Pinyin as default pronunciation --- src/app/texts/[textId]/PassageDisplayOptionsForm.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/texts/[textId]/PassageDisplayOptionsForm.tsx b/src/app/texts/[textId]/PassageDisplayOptionsForm.tsx index 79164f1..c06afa3 100644 --- a/src/app/texts/[textId]/PassageDisplayOptionsForm.tsx +++ b/src/app/texts/[textId]/PassageDisplayOptionsForm.tsx @@ -176,7 +176,7 @@ export function PassageDisplayOptionsForm({ name="qieyun" id="qieyun-decorated-onyomi" value="decorated-onyomi" - checked={displayOptions.qieyun === "decorated-onyomi"} + checked={!displayOptions.qieyun || displayOptions.qieyun === "decorated-onyomi"} onChange={() => setDisplayOptions((opts) => ({ ...opts, @@ -250,7 +250,7 @@ export function PassageDisplayOptionsForm({ } export function useDisplayOptions() { - const [displayOptions, setDisplayOptions] = useState(() => { + const [displayOptions, setDisplayOptions] = useState((): DisplayOptions => { const storedString = globalThis.window && localStorage.getItem("displayOptions"); const parsed = storedString ? JSON.parse(storedString) : null; @@ -258,9 +258,10 @@ export function useDisplayOptions() { return parsed; } return { - ruby: "vi", + ruby: "pinyin", translation: "gloss", version: LATEST_DISPLAY_OPTIONS_VERSION, + qieyun: "decorated-onyomi" }; }); const initialized = useRef(false);