diff --git a/plugins/TidalTags/src/Settings.ts b/plugins/TidalTags/src/Settings.ts index 9b2c5aa..02ec1d2 100644 --- a/plugins/TidalTags/src/Settings.ts +++ b/plugins/TidalTags/src/Settings.ts @@ -5,12 +5,16 @@ import { storage } from "@plugin"; import { setStreamQualityIndicator } from "./streamQualitySelector"; import { updateTrackLists } from "./updateTrackElements"; +storage.showTags ??= true; storage.showFLACInfo ??= true; storage.showFLACInfoBorder ??= false; storage.showAllQualities ??= true; storage.showAtmosQuality ??= true; export const Settings = () => { setTimeout(() => { + const showTags = document.getElementById("showTags"); + if (showTags instanceof HTMLInputElement && showTags.checked !== storage.showTags) showTags!.checked = storage.showTags; + const showFLACInfo = document.getElementById("showFLACInfo"); if (showFLACInfo instanceof HTMLInputElement && showFLACInfo.checked !== storage.showFLACInfo) showFLACInfo!.checked = storage.showFLACInfo; @@ -25,53 +29,49 @@ export const Settings = () => { }); const onChange = (key: string) => (e: { target: { checked: boolean } }) => { - switch (key) { - case "showFLACInfo": - storage.showFLACInfo = e.target.checked; - break; - case "showFLACInfoBorder": - storage.showFLACInfoBorder = e.target.checked; - break; - case "showAllQualities": - storage.showAllQualities = e.target.checked; - break; - case "showAtmosQuality": - storage.showAtmosQuality = e.target.checked; - break; - } + storage[key] = e.target.checked; setStreamQualityIndicator(); updateTrackLists(); }; return html`
Display MQA if HiRes is avalible.
+Display Quality Tags.
-Display the Atmos Quality tags.
- +Display MQA if HiRes is avalible.
+ -Show Sample Rate/Bit Depth
- +Display the Atmos Quality tags.
+ -Show a border around the FLAC Info
- +Show Sample Rate/Bit Depth
+ + +Show a border around the FLAC Info
+ +