diff --git a/frontend/src/reports/import/Extract.svelte b/frontend/src/reports/import/Extract.svelte index 302d9d8d3..2f52889cb 100644 --- a/frontend/src/reports/import/Extract.svelte +++ b/frontend/src/reports/import/Extract.svelte @@ -14,25 +14,24 @@ $: shown = entries.length > 0; $: entry = entries[currentIndex]; $: duplicate = entry && isDuplicate(entry); - $: skipDuplicates = true; $: duplicates = entries.filter(isDuplicate).length; $: if (entries.length > 0 && currentIndex >= entries.length) { currentIndex = 0; } - function nextEntry() { - if(skipDuplicates) { - for (let index = currentIndex+1; index < entries.length; index+=1) { - const newEntry = entries[index]; - if (newEntry !== undefined && !isDuplicate(newEntry)) { - currentIndex = index; - return; - } + function nextNonDuplicateEntry() { + for (let index = currentIndex+1; index < entries.length; index+=1) { + const newEntry = entries[index]; + if (newEntry !== undefined && !isDuplicate(newEntry)) { + currentIndex = index; + return; } - currentIndex = entries.length-1; - }else{ - currentIndex += 1; } + currentIndex = entries.length-1; + } + + function nextEntry() { + currentIndex += 1; } function submitOrNext() { @@ -43,19 +42,19 @@ } } - function previousEntry() { - if(skipDuplicates) { - for (let index = currentIndex-1; index >= 0; index-=1) { - const newEntry = entries[index]; - if (newEntry !== undefined && !isDuplicate(newEntry)) { - currentIndex = index; - return; - } + function previousNonDuplicateEntry() { + for (let index = currentIndex-1; index >= 0; index-=1) { + const newEntry = entries[index]; + if (newEntry !== undefined && !isDuplicate(newEntry)) { + currentIndex = index; + return; } - currentIndex = 0; - }else{ - currentIndex = Math.max(currentIndex - 1, 0); } + currentIndex = 0; + } + + function previousEntry() { + currentIndex = Math.max(currentIndex - 1, 0); } function toggleDuplicate() { @@ -63,9 +62,6 @@ entry.meta.__duplicate__ = !entry.meta.__duplicate__; } } - function toggleSkipDuplicates() { - skipDuplicates = !skipDuplicates; - } @@ -105,21 +101,19 @@ > ⏮ - + {/if} - {#if currentIndex < entries.length - 1} - + +