Fix nullish types

This commit is contained in:
Adria Navarro 2024-12-30 11:02:40 +01:00
parent fafa0472d7
commit d21e25f72d
4 changed files with 6 additions and 4 deletions

View File

@ -91,7 +91,7 @@ export const initialise = (context: StoreContext) => {
} }
// Wipe state // Wipe state
filter.set(get(initialFilter)) filter.set(get(initialFilter) ?? undefined)
inlineFilters.set([]) inlineFilters.set([])
sort.set({ sort.set({
column: get(initialSortColumn), column: get(initialSortColumn),

View File

@ -108,7 +108,7 @@ export const initialise = (context: StoreContext) => {
} }
// Wipe state // Wipe state
filter.set(get(initialFilter)) filter.set(get(initialFilter) ?? undefined)
inlineFilters.set([]) inlineFilters.set([])
sort.set({ sort.set({
column: get(initialSortColumn), column: get(initialSortColumn),

View File

@ -121,7 +121,7 @@ export const initialise = (context: StoreContext) => {
} }
// Reset state for new view // Reset state for new view
filter.set(get(initialFilter)) filter.set(get(initialFilter) ?? undefined)
inlineFilters.set([]) inlineFilters.set([])
sort.set({ sort.set({
column: get(initialSortColumn), column: get(initialSortColumn),

View File

@ -120,5 +120,7 @@ export const initialise = (context: StoreContext) => {
const { filter, initialFilter } = context const { filter, initialFilter } = context
// Reset filter when initial filter prop changes // Reset filter when initial filter prop changes
initialFilter.subscribe(filter.set) initialFilter.subscribe($initialFilter =>
filter.set($initialFilter ?? undefined)
)
} }