feat: update @valkyr/db -> 3.0.2

This commit is contained in:
2026-01-07 02:42:24 +01:00
parent 704d0d1821
commit 7336cfd411
3 changed files with 18 additions and 6 deletions

View File

@@ -34,7 +34,7 @@
"@tailwindcss/vite": "4.1.17",
"@tanstack/react-router": "1.139.9",
"@tanstack/react-table": "8.21.3",
"@valkyr/db": "npm:@jsr/valkyr__db@3.0.1",
"@valkyr/db": "npm:@jsr/valkyr__db@3.0.2",
"@zitadel/react": "1.1.0",
"class-variance-authority": "0.7.1",
"clsx": "2.1.1",

View File

@@ -82,8 +82,20 @@ export const payment = new IndexedDB({
});
export async function loadBeneficiaries(): Promise<void> {
if (hasCacheKey("beneficiaries")) {
return; // don't re-fetch the same key
}
setCacheKey("beneficiaries");
const result = await api.payment.benficiaries.list();
if ("data" in result) {
payment.collection("beneficiary").insert(result.data);
}
}
function hasCacheKey(key: string): boolean {
return localStorage.getItem(key) !== null;
}
function setCacheKey(key: string): void {
localStorage.setItem(key, "cached");
}