fix(overlay): re-add score stats toggle
All checks were successful
deploy / deploy (push) Successful in 59s

This commit is contained in:
Lee 2023-11-05 21:12:08 +00:00
parent a49fa9dbb6
commit c9a6703d94
2 changed files with 19 additions and 0 deletions

View File

@ -107,6 +107,14 @@ export default function Analytics() {
settingsStore.setShowSongInfo(value);
}}
/>
<SwitchInput
id="show-score-stats"
label="Show Song Info"
defaultChecked={settingsStore.settings.showScoreStats}
onChange={(value) => {
settingsStore.setShowScoreStats(value);
}}
/>
</div>
<Button

View File

@ -11,6 +11,7 @@ interface OverlaySettingsStore {
settings: {
showPlayerStats: boolean;
showSongInfo: boolean;
showScoreStats: boolean;
};
setIpAddress: (ipAddress: string) => void;
@ -18,6 +19,7 @@ interface OverlaySettingsStore {
setPlatform: (platform: string) => void;
setShowPlayerStats: (showPlayerStats: boolean) => void;
setShowSongInfo: (showSongInfo: boolean) => void;
setShowScoreStats: (showScoreStats: boolean) => void;
}
export const useOverlaySettingsStore = create<OverlaySettingsStore>()(
@ -29,6 +31,7 @@ export const useOverlaySettingsStore = create<OverlaySettingsStore>()(
settings: {
showPlayerStats: true,
showSongInfo: true,
showScoreStats: true,
},
setIpAddress(ipAddress: string) {
@ -62,6 +65,14 @@ export const useOverlaySettingsStore = create<OverlaySettingsStore>()(
},
});
},
setShowScoreStats(showScoreStats: boolean) {
set({
settings: {
...get().settings,
showScoreStats,
},
});
},
}),
{
name: "overlaySettings",