reload the records counter and remove drafts failures from LocalStorage

This commit is contained in:
Gani Georgiev 2023-10-01 15:57:20 +03:00
parent d69181cfef
commit 5732bc38e3
4 changed files with 12 additions and 4 deletions

View File

@ -13,7 +13,7 @@
- Various Admin UI improvements: - Various Admin UI improvements:
- Count the total records separately to speed up the query execution for large datasets ([#3344](https://github.com/pocketbase/pocketbase/issues/3344)). - Count the total records separately to speed up the query execution for large datasets ([#3344](https://github.com/pocketbase/pocketbase/issues/3344)).
- Enclosed the listing scrolling area within the table so that the horizontal scrollbar and table header are always reachable ([#2505](https://github.com/pocketbase/pocketbase/issues/2505)). - Enclosed the listing scrolling area within the table so that the horizontal scrollbar and table header are always reachable ([#2505](https://github.com/pocketbase/pocketbase/issues/2505)).
- Allowed opening the record update form via direct URL ([#2682](https://github.com/pocketbase/pocketbase/discussions/2682)). - Allowed opening the record preview/update form via direct URL ([#2682](https://github.com/pocketbase/pocketbase/discussions/2682)).
- Reintroduced the local `date` field tooltip on hover. - Reintroduced the local `date` field tooltip on hover.
- Speed up the listing loading times for records with large `editor` field values by initially fetching only a partial of the records data (the complete record data is loaded on record preview/update). - Speed up the listing loading times for records with large `editor` field values by initially fetching only a partial of the records data (the complete record data is loaded on record preview/update).

View File

@ -175,7 +175,12 @@
</button> </button>
{/if} {/if}
<RefreshButton on:refresh={() => recordsList?.load()} /> <RefreshButton
on:refresh={() => {
recordsList?.load();
recordsCount?.reload();
}}
/>
</div> </div>
<div class="btns-group"> <div class="btns-group">

View File

@ -184,6 +184,7 @@
// ignore local storage errors in case the serialized data // ignore local storage errors in case the serialized data
// exceed the browser localStorage single value quota // exceed the browser localStorage single value quota
console.warn("updateDraft failure:", e); console.warn("updateDraft failure:", e);
window.localStorage.removeItem(draftKey());
} }
} }
@ -535,11 +536,12 @@
{/if} {/if}
</svelte:fragment> </svelte:fragment>
<div class="tabs-content"> <div class="tabs-content no-animations">
<!-- svelte-ignore a11y-no-noninteractive-element-interactions --> <!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
<form <form
id={formId} id={formId}
class="tab-item" class="tab-item"
class:no-pointer-events={isLoading}
class:active={activeTab === tabFormKey} class:active={activeTab === tabFormKey}
on:submit|preventDefault={save} on:submit|preventDefault={save}
on:keydown={handleFormKeydown} on:keydown={handleFormKeydown}

View File

@ -5,7 +5,7 @@
import { onMount } from "svelte"; import { onMount } from "svelte";
export let field; export let field;
export let value = undefined; export let value = "";
let mounted = false; let mounted = false;
let mountedTimeoutId = null; let mountedTimeoutId = null;
@ -22,6 +22,7 @@
} }
onMount(() => { onMount(() => {
// slight "offset" the editor mount to avoid blocking the rendering of the other fields
mountedTimeoutId = setTimeout(() => { mountedTimeoutId = setTimeout(() => {
mounted = true; mounted = true;
}, 100); }, 100);