[bugfix]: Validate audio sample range, catch AudioContext error (#470)

This commit is contained in:
Kendall Garner 2024-01-25 04:36:20 +00:00 committed by GitHub
parent 3bca85b3a8
commit 5f1d0a3b5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 32 additions and 8 deletions

View file

@ -251,6 +251,7 @@ export interface SettingsState {
export interface SettingsSlice extends SettingsState {
actions: {
reset: () => void;
resetSampleRate: () => void;
setSettings: (data: Partial<SettingsState>) => void;
setSidebarItems: (items: SidebarItemType[]) => void;
setTable: (type: TableType, data: DataTableProps) => void;
@ -567,6 +568,11 @@ export const useSettingsStore = create<SettingsSlice>()(
set(initialState);
}
},
resetSampleRate: () => {
set((state) => {
state.playback.mpvProperties.audioSampleRateHz = 0;
});
},
setSettings: (data) => {
set({ ...get(), ...data });
},