mirror of
https://github.com/zhigang1992/devhub.git
synced 2026-06-18 03:58:44 +08:00
Fix column of undefined
This commit is contained in:
@@ -17,7 +17,7 @@ export const columnsReducer: Reducer<State> = (
|
||||
switch (action.type) {
|
||||
case REHYDRATE as any:
|
||||
return immer(state, draft => {
|
||||
const columns = columnsSelector(action.payload as any)
|
||||
const columns = columnsSelector((action.payload as any) || {})
|
||||
|
||||
draft.columns = columns || []
|
||||
draft.columns = draft.columns.filter(c => c && c.id)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { RootState } from '../../types'
|
||||
|
||||
const s = (state: RootState) => state.auth
|
||||
const s = (state: RootState) => state.auth || {}
|
||||
|
||||
export const errorSelector = (state: RootState) => s(state).error
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RootState } from '../../types'
|
||||
|
||||
const s = (state: RootState) => state.columns
|
||||
const s = (state: RootState) => state.columns || {}
|
||||
|
||||
export const columnsSelector = (state: RootState) => s(state).columns
|
||||
|
||||
@@ -4,7 +4,7 @@ import { loadTheme } from '../../styles/utils'
|
||||
import { RootState } from '../../types'
|
||||
import { isNight } from '../../utils/helpers/shared'
|
||||
|
||||
const s = (state: RootState) => state.config
|
||||
const s = (state: RootState) => state.config || {}
|
||||
|
||||
export const themePairSelector = (state: RootState) => s(state).theme
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { RootState } from '../../types'
|
||||
|
||||
const s = (state: RootState) => state.navigation
|
||||
const s = (state: RootState) => state.navigation || {}
|
||||
|
||||
export const modalStack = (state: RootState) => s(state).modalStack
|
||||
|
||||
|
||||
Reference in New Issue
Block a user