mirror of
https://github.com/koodo-reader/koodo-reader.git
synced 2026-06-18 21:00:35 -04:00
fix bug
Former-commit-id: 885dd2b4f72c3a667c5d4fc949ec738f70aa9fac
This commit is contained in:
@@ -68,10 +68,12 @@ class PopupNote extends React.Component<PopupNoteProps, PopupNoteState> {
|
||||
let highlightersByChapter = highlighters.filter((item: Note) => {
|
||||
if (this.props.currentBook.format !== "PDF") {
|
||||
return (
|
||||
item.chapter ===
|
||||
(item.chapter ===
|
||||
this.props.htmlBook.rendition.getChapterDoc()[
|
||||
this.props.chapterDocIndex
|
||||
].label && item.bookKey === this.props.currentBook.key
|
||||
].label ||
|
||||
item.chapterIndex === this.props.chapterDocIndex) &&
|
||||
item.bookKey === this.props.currentBook.key
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
|
||||
@@ -123,14 +123,17 @@ class PopupOption extends React.Component<PopupOptionProps> {
|
||||
};
|
||||
handleHighlight = () => {
|
||||
let highlighters: any = this.props.notes;
|
||||
console.log(highlighters);
|
||||
if (!highlighters) return;
|
||||
let highlightersByChapter = highlighters.filter((item: Note) => {
|
||||
if (this.props.currentBook.format !== "PDF") {
|
||||
return (
|
||||
item.chapter ===
|
||||
(item.chapter ===
|
||||
this.props.htmlBook.rendition.getChapterDoc()[
|
||||
this.props.chapterDocIndex
|
||||
].label && item.bookKey === this.props.currentBook.key
|
||||
].label ||
|
||||
item.chapterIndex === this.props.chapterDocIndex) &&
|
||||
item.bookKey === this.props.currentBook.key
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
@@ -139,7 +142,7 @@ class PopupOption extends React.Component<PopupOptionProps> {
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
console.log(highlightersByChapter);
|
||||
renderHighlighters(
|
||||
highlightersByChapter,
|
||||
this.props.currentBook.format,
|
||||
|
||||
@@ -82,12 +82,14 @@ class Viewer extends React.Component<ViewerProps, ViewerState> {
|
||||
};
|
||||
handleHighlight = (rendition: any) => {
|
||||
let highlighters: any = this.props.notes;
|
||||
console.log(highlighters);
|
||||
if (!highlighters) return;
|
||||
let highlightersByChapter = highlighters.filter((item: Note) => {
|
||||
if (this.props.currentBook.format !== "PDF") {
|
||||
return (
|
||||
item.chapter ===
|
||||
rendition.getChapterDoc()[this.state.chapterDocIndex].label &&
|
||||
(item.chapter ===
|
||||
rendition.getChapterDoc()[this.state.chapterDocIndex].label ||
|
||||
item.chapterIndex === this.state.chapterDocIndex) &&
|
||||
item.bookKey === this.props.currentBook.key
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -17,6 +17,7 @@ export const renderHighlighters = async (
|
||||
"line-3",
|
||||
];
|
||||
clearHighlight();
|
||||
console.log(notes);
|
||||
for (let index = 0; index < notes.length; index++) {
|
||||
const item = notes[index];
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user