fix: search shows 1 chord when there are 0

fixes #151
This commit is contained in:
2025-02-14 15:42:19 +01:00
parent fb5959998a
commit 45c5f21cc4

View File

@@ -156,7 +156,7 @@
if (abort) return index; if (abort) return index;
const chord = chords[i]!; const chord = chords[i]!;
progress = i; progress = i + 1;
if ("phrase" in chord) { if ("phrase" in chord) {
await index.addAsync(i, encodeChord(chord, osLayout, codes)); await index.addAsync(i, encodeChord(chord, osLayout, codes));
@@ -255,9 +255,9 @@
<div class="search-container"> <div class="search-container">
<input <input
type="search" type="search"
placeholder={$LL.configure.chords.search.PLACEHOLDER(progress + 1)} placeholder={$LL.configure.chords.search.PLACEHOLDER(progress)}
oninput={(event) => $searchIndex && search($searchIndex, event)} oninput={(event) => $searchIndex && search($searchIndex, event)}
class:loading={progress !== $chords.length - 1} class:loading={progress !== $chords.length}
/> />
<div class="paginator"> <div class="paginator">
{#if $lastPage !== -1} {#if $lastPage !== -1}