fixed 0 total count on page back/forward navigation

This commit is contained in:
Gani Georgiev
2026-04-21 10:26:04 +03:00
parent bf1745fa13
commit 0cee0662f6
6 changed files with 93 additions and 86 deletions

View File

@@ -1,3 +1,8 @@
## v0.37.3 (WIP)
- Fixed 0 total count on page back/forward navigation.
## v0.37.2
- Fixed autoexpandable input in Firefox ([#7648](https://github.com/pocketbase/pocketbase/discussions/7648)).

View File

@@ -11,4 +11,4 @@ PB_DOCS_URL = "https://pocketbase.io/docs"
PB_JS_SDK_URL = "https://github.com/pocketbase/js-sdk"
PB_DART_SDK_URL = "https://github.com/pocketbase/dart-sdk"
PB_RELEASES = "https://github.com/pocketbase/pocketbase/releases"
PB_VERSION = "v0.37.2"
PB_VERSION = "v0.37.3-dev"

81
ui/dist/assets/index-CoBufq4Q.js vendored Normal file
View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

2
ui/dist/index.html vendored
View File

@@ -13,7 +13,7 @@
<!-- prism -->
<script src="./libs/prism/prism.js" data-manual></script>
<script type="module" crossorigin src="./assets/index-Un_20Bdf.js"></script>
<script type="module" crossorigin src="./assets/index-CoBufq4Q.js"></script>
<link rel="modulepreload" crossorigin href="./assets/pocketbase.es-B_4DUNUU.js">
<link rel="stylesheet" crossorigin href="./assets/index-Cdd8TSHO.css">
</head>

View File

@@ -5,9 +5,10 @@ const FILTER_QUERY_KEY = "filter";
const COLLECTION_QUERY_KEY = "collection";
const RECORD_QUERY_KEY = "record";
const LAST_ACTIVE_STORAGE_KEY = "pbLastActiveCollection";
const TOTAL_COUNT_REQUEST_KEY = "recordsTotalCountRequest";
export function pageCollections(route) {
const uniqueId = "page_collections_" + app.utils.randomString();
app.store.activeCollection = route.query[COLLECTION_QUERY_KEY]?.[0]
|| window.localStorage.getItem(LAST_ACTIVE_STORAGE_KEY);
@@ -34,7 +35,8 @@ export function pageCollections(route) {
);
const result = await app.pb.collection(app.store.activeCollection.name).getList(1, 1, {
requestKey: TOTAL_COUNT_REQUEST_KEY,
// use a per page unique id and not a global constant to prevent race issues with the async unmount
requestKey: uniqueId,
filter: normalizedFilter,
fields: "id",
});
@@ -184,7 +186,7 @@ export function pageCollections(route) {
}
},
onunmount: () => {
app.pb.cancelRequest(TOTAL_COUNT_REQUEST_KEY);
app.pb.cancelRequest(uniqueId);
watchers.forEach((w) => w?.unwatch());