Skip to content

Commit

Permalink
Merge pull request #469 from d-i-t-a/bugfix/search-paint-and-obfuscation
Browse files Browse the repository at this point in the history
search paint and obfuscation fix
  • Loading branch information
aferditamuriqi authored Jul 11, 2023
2 parents 333d072 + 8d0e179 commit bd61ae0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@d-i-t-a/reader",
"version": "2.3.7",
"version": "2.3.8",
"description": "A viewer application for EPUB files.",
"repository": "https://github.com/d-i-t-a/R2D2BC",
"license": "Apache-2.0",
Expand Down
24 changes: 18 additions & 6 deletions src/modules/search/SearchModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ export class SearchModule implements ReaderModule {
self.currentChapterSearchResult = [];
self.currentSearchHighlights = [];
var localSearchResultChapter: any = [];
if (this.navigator.rights.enableContentProtection) {
this.navigator.contentProtectionModule?.deactivate();
}
await this.searchAndPaintChapter(searchVal, index, async (result) => {
localSearchResultChapter = result;
goToResultPage(1);
Expand Down Expand Up @@ -292,6 +289,9 @@ export class SearchModule implements ReaderModule {
index: number = 0,
callback: (result: any) => any
) {
if (this.navigator.rights.enableContentProtection) {
this.navigator.contentProtectionModule?.deactivate();
}
const linkHref = this.publication.getAbsoluteHref(
this.publication.readingOrder[this.navigator.currentResource() ?? 0].Href
);
Expand Down Expand Up @@ -398,7 +398,11 @@ export class SearchModule implements ReaderModule {
this.bookSearchResult = [];

reset();
await this.searchAndPaintChapter(term, 0, async () => {});
await this.searchAndPaintChapter(term, 0, async () => {
if (this.navigator.rights.enableContentProtection) {
this.navigator.contentProtectionModule?.recalculate(200);
}
});

if (current) {
await this.searchBook(term);
Expand Down Expand Up @@ -452,7 +456,11 @@ export class SearchModule implements ReaderModule {
this.searchAndPaintChapter(
item.textMatch,
filteredIndex,
async () => {}
async () => {
if (this.navigator.rights.enableContentProtection) {
this.navigator.contentProtectionModule?.recalculate(200);
}
}
);
}, 300);
}
Expand Down Expand Up @@ -498,7 +506,11 @@ export class SearchModule implements ReaderModule {
this.searchAndPaintChapter(
item.textMatch,
filteredIndex,
async () => {}
async () => {
if (this.navigator.rights.enableContentProtection) {
this.navigator.contentProtectionModule?.recalculate(200);
}
}
);
}, 300);
}
Expand Down

0 comments on commit bd61ae0

Please sign in to comment.