@@ -57,7 +57,7 @@ export const ContractStorage = ({
5757 const { transaction } = useStore ( ) ;
5858 const router = useRouter ( ) ;
5959
60- const [ currentCursor , setCurrentCursor ] = useState < string | undefined > ( ) ;
60+ const [ currentHref , setCurrentHref ] = useState < string | undefined > ( ) ;
6161 const [ currentPage , setCurrentPage ] = useState ( 1 ) ;
6262 const [ sortBy , setSortBy ] = useState < string > ( "updated_at" ) ;
6363 const [ sortOrder , setSortOrder ] = useState < "asc" | "desc" > ( "desc" ) ;
@@ -67,7 +67,7 @@ export const ContractStorage = ({
6767 isActive : isActive && ! isSourceStellarExpert ,
6868 networkId,
6969 contractId,
70- cursor : currentCursor ,
70+ paginationHref : currentHref ,
7171 sortBy,
7272 order : sortOrder ,
7373 } ) ;
@@ -82,7 +82,7 @@ export const ContractStorage = ({
8282
8383 useEffect ( ( ) => {
8484 // Reset when contractId or networkId changes
85- setCurrentCursor ( undefined ) ;
85+ setCurrentHref ( undefined ) ;
8686 setCurrentPage ( 1 ) ;
8787 setSortBy ( "updated_at" ) ;
8888 setSortOrder ( "desc" ) ;
@@ -148,12 +148,6 @@ export const ContractStorage = ({
148148 ) ;
149149 }
150150
151- const getCursorFromHref = ( href : string ) => {
152- const queryString = href . split ( "?" ) [ 1 ] || "" ;
153- const params = new URLSearchParams ( queryString ) ;
154- return params . get ( "cursor" ) || undefined ;
155- } ;
156-
157151 const parsedKeyValueData = ( ) => {
158152 return storageData . map ( ( i ) => ( {
159153 ...i ,
@@ -325,7 +319,7 @@ export const ContractStorage = ({
325319 setSortOrder ( dir ) ;
326320 }
327321 // Reset pagination on sort change
328- setCurrentCursor ( undefined ) ;
322+ setCurrentHref ( undefined ) ;
329323 setCurrentPage ( 1 ) ;
330324 } ,
331325 }
@@ -336,7 +330,7 @@ export const ContractStorage = ({
336330 prev : {
337331 onClick : ( ) => {
338332 if ( prevCursor ) {
339- setCurrentCursor ( getCursorFromHref ( prevCursor ) ) ;
333+ setCurrentHref ( prevCursor ) ;
340334 setCurrentPage ( Math . max ( currentPage - 1 , 1 ) ) ;
341335 }
342336 } ,
@@ -346,7 +340,7 @@ export const ContractStorage = ({
346340 next : {
347341 onClick : ( ) => {
348342 if ( nextCursor ) {
349- setCurrentCursor ( getCursorFromHref ( nextCursor ) ) ;
343+ setCurrentHref ( nextCursor ) ;
350344 setCurrentPage ( currentPage + 1 ) ;
351345 }
352346 } ,
0 commit comments