File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -101,16 +101,19 @@ const AppHeader = () => {
101
101
//check if the value of this key is false. If so, set the setupCompleted state to false
102
102
//if none is found, set the setupCompleted state to true
103
103
useEffect ( ( ) => {
104
- if ( dashboard && dashboard . length >= 1 ) {
104
+ if ( dashboard && Array . isArray ( dashboard ) && dashboard . length >= 1 ) {
105
105
console . log ( 'Finding if setup is completed.' )
106
- const setupCompleted = dashboard . find ( ( alert ) => alert . setupCompleted === false )
106
+ const setupCompleted = dashboard . find ( ( alert ) => alert && alert . setupCompleted === false )
107
107
if ( setupCompleted ) {
108
108
console . log ( "Setup isn't completed yet, we found a match with false." )
109
109
dispatch ( setSetupCompleted ( { setupCompleted : false } ) )
110
110
} else {
111
111
console . log ( 'Setup is completed.' )
112
112
dispatch ( setSetupCompleted ( { setupCompleted : true } ) )
113
113
}
114
+ } else {
115
+ console . log ( 'Setup is completed.' )
116
+ dispatch ( setSetupCompleted ( { setupCompleted : true } ) )
114
117
}
115
118
} , [ dashboard , dispatch ] )
116
119
You can’t perform that action at this time.
0 commit comments