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') {
|
if (name === 'historyDetectLanguagesEnabledList' && typeof value === 'string') {
|
||||||
return set(() => ({
|
return set(() => ({
|
||||||
historyDetectLanguagesEnabledList: value.split(','),
|
historyDetectLanguagesEnabledList: value.split(',').filter(Boolean),
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name === 'protectedCollections' && typeof value === 'string') {
|
|
||||||
return set(() => ({
|
|
||||||
protectedCollections: value.split(','),
|
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name === 'appToursCompletedList' && typeof value === 'string') {
|
if (name === 'appToursCompletedList' && typeof value === 'string') {
|
||||||
return set(() => ({
|
return set(() => ({
|
||||||
appToursCompletedList: value.split(','),
|
appToursCompletedList: value.split(',').filter(Boolean),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name === 'appToursSkippedList' && typeof value === 'string') {
|
if (name === 'appToursSkippedList' && typeof value === 'string') {
|
||||||
return set(() => ({
|
return set(() => ({
|
||||||
appToursSkippedList: value.split(','),
|
appToursSkippedList: value.split(',').filter(Boolean),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name === 'historyDetectLanguagesPrioritizedList' && typeof value === 'string') {
|
if (name === 'historyDetectLanguagesPrioritizedList' && typeof value === 'string') {
|
||||||
return set(() => ({
|
return set(() => ({
|
||||||
historyDetectLanguagesPrioritizedList: value.split(','),
|
historyDetectLanguagesPrioritizedList: value.split(',').filter(Boolean),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { invoke } from '@tauri-apps/api'
|
import { invoke } from '@tauri-apps/api'
|
||||||
import { appWindow, availableMonitors, WebviewWindow } from '@tauri-apps/api/window'
|
import { WebviewWindow } from '@tauri-apps/api/window'
|
||||||
import { atom } from 'jotai'
|
|
||||||
import { atomWithStore } from 'jotai-zustand'
|
import { atomWithStore } from 'jotai-zustand'
|
||||||
import { createJSONStorage, persist } from 'zustand/middleware'
|
import { createJSONStorage, persist } from 'zustand/middleware'
|
||||||
import { createStore } from 'zustand/vanilla'
|
import { createStore } from 'zustand/vanilla'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user