reorder records list watchers and cancel prev count requests

This commit is contained in:
Gani Georgiev
2026-04-19 08:15:58 +03:00
parent 3ad737e606
commit e41f43241b
6 changed files with 65 additions and 52 deletions

View File

@@ -69,13 +69,15 @@ export function otpAccordion(collection) {
}),
() => {
if (!data.isSuperusers) {
return
return;
}
return t.i({
className: "ri-information-line link-hint",
ariaDescription: app.attrs.tooltip("Superusers can have OTP only as part of Two-factor authentication."),
})
ariaDescription: app.attrs.tooltip(
"Superusers can have OTP only as part of Two-factor authentication.",
),
});
},
),
),

View File

@@ -5,6 +5,7 @@ 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) {
app.store.activeCollection = route.query[COLLECTION_QUERY_KEY]?.[0]
@@ -33,6 +34,7 @@ export function pageCollections(route) {
);
const result = await app.pb.collection(app.store.activeCollection.name).getList(1, 1, {
requestKey: TOTAL_COUNT_REQUEST_KEY,
filter: normalizedFilter,
fields: "id",
});
@@ -182,6 +184,8 @@ export function pageCollections(route) {
}
},
onunmount: () => {
app.pb.cancelRequest(TOTAL_COUNT_REQUEST_KEY);
watchers.forEach((w) => w?.unwatch());
for (let event in documentEvents) {