refactor: streamline list handling in settingsStore to filter out empty values for improved data accuracy
This commit is contained in:
parent
3a4ca0651a
commit
9d850924d8
@ -449,31 +449,25 @@ export const settingsStore = createStore<SettingsStoreState & Settings>()((set,
|
||||
|
||||
if (name === 'historyDetectLanguagesEnabledList' && typeof value === 'string') {
|
||||
return set(() => ({
|
||||
historyDetectLanguagesEnabledList: value.split(','),
|
||||
}))
|
||||
}
|
||||
|
||||
if (name === 'protectedCollections' && typeof value === 'string') {
|
||||
return set(() => ({
|
||||
protectedCollections: value.split(','),
|
||||
historyDetectLanguagesEnabledList: value.split(',').filter(Boolean),
|
||||
}))
|
||||
}
|
||||
|
||||
if (name === 'appToursCompletedList' && typeof value === 'string') {
|
||||
return set(() => ({
|
||||
appToursCompletedList: value.split(','),
|
||||
appToursCompletedList: value.split(',').filter(Boolean),
|
||||
}))
|
||||
}
|
||||
|
||||
if (name === 'appToursSkippedList' && typeof value === 'string') {
|
||||
return set(() => ({
|
||||
appToursSkippedList: value.split(','),
|
||||
appToursSkippedList: value.split(',').filter(Boolean),
|
||||
}))
|
||||
}
|
||||
|
||||
if (name === 'historyDetectLanguagesPrioritizedList' && typeof value === 'string') {
|
||||
return set(() => ({
|
||||
historyDetectLanguagesPrioritizedList: value.split(','),
|
||||
historyDetectLanguagesPrioritizedList: value.split(',').filter(Boolean),
|
||||
}))
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { invoke } from '@tauri-apps/api'
|
||||
import { appWindow, availableMonitors, WebviewWindow } from '@tauri-apps/api/window'
|
||||
import { atom } from 'jotai'
|
||||
import { WebviewWindow } from '@tauri-apps/api/window'
|
||||
import { atomWithStore } from 'jotai-zustand'
|
||||
import { createJSONStorage, persist } from 'zustand/middleware'
|
||||
import { createStore } from 'zustand/vanilla'
|
||||
|
Loading…
x
Reference in New Issue
Block a user