From ff532679a7db0cfd099e2a199d0ccf7c5acd3342 Mon Sep 17 00:00:00 2001 From: Brandon Ferrari Date: Wed, 7 Jul 2021 16:04:30 -0400 Subject: [PATCH] add the ability to remove the status message when no results / no more to load --- src/InfiniteLoading.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/InfiniteLoading.svelte b/src/InfiniteLoading.svelte index 803dd00..42a0186 100644 --- a/src/InfiniteLoading.svelte +++ b/src/InfiniteLoading.svelte @@ -159,6 +159,7 @@ export let direction = 'bottom'; export let forceUseInfiniteWrapper = false; export let identifier = +new Date(); + export let hideStatus = false; let isFirstLoad = true; // save the current loading whether it is the first loading let status = STATUS.READY; @@ -168,8 +169,8 @@ $: showSpinner = status === STATUS.LOADING; $: showError = status === STATUS.ERROR; - $: showNoResults = status === STATUS.COMPLETE && isFirstLoad; - $: showNoMore = status === STATUS.COMPLETE && !isFirstLoad; + $: showNoResults = status === STATUS.COMPLETE && isFirstLoad && !hideStatus; + $: showNoMore = status === STATUS.COMPLETE && !isFirstLoad && !hideStatus; const stateChanger = { loaded: async () => {