File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,8 +119,11 @@ const Interact = () => {
119119 const saved = localStorage . getItem ( 'ABOUT_currentPage' ) ;
120120 if ( saved ) {
121121 setCurrentPage ( parseInt ( saved ) ) ;
122+ const next_page = ( parseInt ( saved ) + 1 ) % pages . length ;
123+ setNextPage ( next_page ) ;
122124 } else {
123125 setCurrentPage ( 1 ) ;
126+ setNextPage ( 2 ) ;
124127 }
125128 } , [ ] ) ;
126129
@@ -142,6 +145,7 @@ const Interact = () => {
142145
143146 // Use a consistent page during server rendering
144147 const page = pages [ currentPage ] ;
148+ const n_page = pages [ nextPage ] ;
145149
146150 return (
147151 < div className = "flex flex-col gap-4" >
@@ -156,7 +160,7 @@ const Interact = () => {
156160 priority
157161 />
158162 { /* preload next image... i wish there was a better way to do this*/ }
159- < link rel = "preload" href = { pages [ nextPage ] . image } as = "image" > </ link >
163+ < link rel = "preload" href = { n_page . image } as = "image" > </ link >
160164 </ div >
161165
162166 < div className = "w-full border-2 border-gray-800 rounded p-2" >
You can’t perform that action at this time.
0 commit comments