Skip to content

Commit

Permalink
Merge pull request runbox#1594 from shadow-dot-cat/castaway/undo-loca…
Browse files Browse the repository at this point in the history
…l-browser

Revert "feat(index): Creates a browser-local index if not downloadable"
  • Loading branch information
castaway authored Aug 28, 2024
2 parents 5fa0788 + ec2da8b commit 63a4765
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/app/xapian/searchservice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,21 +497,21 @@ export class SearchService {
// initSubject returns false if no db yet, but that's fine
// we're downloading it here..
return this.initSubject.pipe(
mergeMap(() => this.checkIfDownloadableIndexExists()),
mergeMap((res) => new Observable<boolean>( (observer) => {
mergeMap(() => this.checkIfDownloadableIndexExists()),
mergeMap((res) => new Observable<boolean>( (observer) => {
if (!res) {
// just create one
this.api.initXapianIndex(XAPIAN_GLASS_WR);
this.localSearchActivated = true;
this.localSearchActivated = false;
this.indexLastUpdateTime = 0;
this.api.closeXapianDatabase();
this.api.initXapianIndexReadOnly(XAPIAN_GLASS_WR);
this.openDBOnWorker();
this.indexReloadedSubject.next(undefined);
this.indexDownloadingInProgress = false;
// restart updates
this.indexWorker.postMessage({'action': PostMessageAction.updateIndexWithNewChanges });
this.stopIndexDownloadingInProgress = true;
observer.next(false);
return;
}

// console.log('Download index');

this.downloadProgress = 0;
let loaded = 0;

Expand Down

0 comments on commit 63a4765

Please sign in to comment.