Skip to content

Commit

Permalink
Merge pull request #42 from jillro/maud/1.9.1-beta2-fixes
Browse files Browse the repository at this point in the history
1.9.1-beta2 fixes
  • Loading branch information
jillro authored Dec 28, 2024
2 parents 164243b + 8d3ba8a commit 676b67a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/components/Root.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@
background-color: var(--background-secondary);
}
& div:not(.loading-bar) {
z-index: 2;
}
& input {
background: transparent;
position: relative;
Expand Down
6 changes: 4 additions & 2 deletions src/components/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ async function updateSearchResults() {
let batch: Map<TFile, boolean> = new Map();
let lastBatch = { date: new Date(), index: 0 };
for (let i = 0; i < $sortedFiles.length; i++) {
if ($searchQuery !== get(searchQuery)) return;

const file = $sortedFiles[i];
const cachedResult = get(searchResultCache).get(cacheKey($sortedFiles[i]));
if (cachedResult !== undefined) {
Expand All @@ -111,10 +109,14 @@ async function updateSearchResults() {
frontmatter,
caseSensitive: $searchCaseSensitive,
});

if ($searchQuery !== get(searchQuery)) return;
batch.set(file, match);
searchResultCache.update((cache) => cache.set(cacheKey(file), match));
}

if ($searchQuery !== get(searchQuery)) return;

if (i % 10 === 0) {
searchResultLoadingState.set(i / $sortedFiles.length);
}
Expand Down

0 comments on commit 676b67a

Please sign in to comment.