@stoker-platform/web-app 0.5.149 → 0.5.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,10 +1,22 @@
1
1
  # @stoker-platform/web-app
2
2
 
3
+ ## 0.5.151
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: process preloaded collection page number change immediately
8
+
9
+ ## 0.5.150
10
+
11
+ ### Patch Changes
12
+
13
+ - fix: fix page number / count when search present
14
+
3
15
  ## 0.5.149
4
16
 
5
17
  ### Patch Changes
6
18
 
7
- - fix: apply isMobile condition on intial retrieval
19
+ - fix: apply isMobile condition on initial retrieval
8
20
 
9
21
  ## 0.5.148
10
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-app",
3
- "version": "0.5.149",
3
+ "version": "0.5.151",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "scripts": {
package/src/List.tsx CHANGED
@@ -814,6 +814,11 @@ export function List({
814
814
  backToStart()
815
815
  }
816
816
  }, 750)
817
+
818
+ if (isInitialized && (isPreloadCacheEnabled || isServerReadOnly)) {
819
+ setPageIndex(0)
820
+ setState(`collection-page-number-${labels.collection.toLowerCase()}`, "page", 1)
821
+ }
817
822
  return () => clearTimeout(timer)
818
823
  }, [search])
819
824
 
@@ -950,13 +955,13 @@ export function List({
950
955
  }
951
956
  }
952
957
  } else if (isInitialized && (isPreloadCacheEnabled || isServerReadOnly)) {
953
- const newPageCount = Math.ceil(list.length / pageSize) || 1
958
+ const newPageCount = Math.ceil(searchList.length / pageSize) || 1
954
959
  if (newPageCount !== pageCount) {
955
960
  setPageCount(newPageCount)
956
961
  }
957
962
  }
958
963
  }
959
- }, [list])
964
+ }, [list, searchList])
960
965
 
961
966
  const nextPage = useCallback(() => {
962
967
  if (isLoading) return