@@ -41,6 +41,7 @@ const iconPath = `${process.env.PUBLIC_URL}/static/icons/`;
41
41
42
42
const Table = ( ) => {
43
43
const [ resetCount , setResetCount ] = useState ( 0 ) ;
44
+
44
45
let checkedList =
45
46
JSON . parse ( localStorage . getItem ( 'checked' ) ) ||
46
47
new Array ( questions . length ) . fill ( false ) ;
@@ -114,11 +115,12 @@ const Table = () => {
114
115
JSON . parse ( localStorage . getItem ( 'showPatterns' ) ) || new Array ( 1 ) . fill ( true ) ,
115
116
) ;
116
117
118
+ const savedImportant = JSON . parse ( localStorage . getItem ( 'importantProblems' ) ) ;
117
119
const [ important , setImportant ] = useState (
118
- JSON . parse ( localStorage . getItem ( 'importantProblems' ) ) ||
119
- new Array ( questions . length ) . fill ( false ) ,
120
+ savedImportant && savedImportant . length === questions . length
121
+ ? savedImportant
122
+ : new Array ( questions . length ) . fill ( false ) ,
120
123
) ;
121
-
122
124
useEffect ( ( ) => {
123
125
localStorage . setItem ( 'importantProblems' , JSON . stringify ( important ) ) ;
124
126
} , [ important ] ) ;
@@ -498,6 +500,8 @@ const Table = () => {
498
500
disableFilters : true ,
499
501
Cell : ( { row } ) => {
500
502
const id = Number ( row ?. original ?. id ) ;
503
+ console . log ( '⭐ Row ID:' , id , row ?. original ) ;
504
+
501
505
if ( Number . isNaN ( id ) ) return '❌' ;
502
506
503
507
const handleKeyPress = e => {
@@ -546,7 +550,7 @@ const Table = () => {
546
550
} ,
547
551
] ,
548
552
// eslint-disable-next-line
549
- [ resetCount ] ,
553
+ [ resetCount , important ] ,
550
554
) ;
551
555
552
556
const {
0 commit comments