diff --git a/src/lib/components/notes/Notes.svelte b/src/lib/components/notes/Notes.svelte index c0d461205f..fa1b6a0253 100644 --- a/src/lib/components/notes/Notes.svelte +++ b/src/lib/components/notes/Notes.svelte @@ -435,36 +435,164 @@ - {#if (items ?? []).length > 0} - {@const notes = groupNotes(items)} + {#if items !== null && total !== null} + {#if (items ?? []).length > 0} + {@const notes = groupNotes(items)} -
-
- {#each Object.keys(notes) as timeRange, idx} -
- {$i18n.t(timeRange)} -
- - {#if displayOption === null} +
+
+ {#each Object.keys(notes) as timeRange, idx}
- {#each notes[timeRange] as note, idx (note.id)} -
- -
-
-
- {note.title} + {$i18n.t(timeRange)} +
+ + {#if displayOption === null} +
+ {:else if displayOption === 'grid'} + - {/each} -
- {:else if displayOption === 'grid'} - - {/if} - {/each} + {/each} +
+ {/if} + {/each} - {#if !allItemsLoaded} - { - if (!itemsLoading) { - loadMoreItems(); - } - }} - > -
{ + if (!itemsLoading) { + loadMoreItems(); + } + }} > - -
{$i18n.t('Loading...')}
-
-
- {/if} -
-
- {:else} -
-
-
- {$i18n.t('No Notes')} +
+ +
{$i18n.t('Loading...')}
+
+ + {/if}
+
+ {:else} +
+
+
+ {$i18n.t('No Notes')} +
-
- {$i18n.t('Create your first note by clicking on the plus button below.')} +
+ {$i18n.t('Create your first note by clicking on the plus button below.')} +
+ {/if} + {:else} +
+
{/if}
{:else}
- +
{/if}