Minor table loading fix (#1580)

Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov 2022-04-28 14:14:48 +06:00 committed by GitHub
parent 18bd545c25
commit 9ef5107ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,7 +42,7 @@
let sortKey = 'modifiedOn'
let sortOrder = SortingOrder.Descending
let loading = false
let loading = 0
let objects: Doc[] = []
const refs: HTMLElement[] = []
@ -73,13 +73,12 @@
objects.sort((a, b) => -1 * sortOrder * sf(a, b))
}
dispatch('content', objects)
loading = false
loading--
},
{ sort: { [sortKey]: sortOrder }, limit: 200, ...options }
)
if (update) {
if (update && ++loading > 0) {
objects = []
loading = true
}
}
$: update(_class, query, sortKey, sortOrder, options)
@ -290,6 +289,6 @@
</table>
{/await}
{#if loading}
{#if loading > 0}
<Loading />
{/if}