Persist EPUB CFI with setAttachmentLastPageIndex()

This commit is contained in:
Abe Jellinek 2023-06-26 12:27:32 -04:00 committed by Dan Stillman
parent d975450ae1
commit 60f8d11c2d
2 changed files with 16 additions and 3 deletions

View file

@ -655,7 +655,10 @@ class ReaderInstance {
if (this._type === 'pdf') {
item.setAttachmentLastPageIndex(state.pageIndex);
}
// epub, snapshot
else if (this._type === 'epub') {
item.setAttachmentLastPageIndex(state.cfi);
}
// snapshot
else {
// setAttachmentSomeProperty(state.someProperty);
}
@ -712,7 +715,17 @@ class ReaderInstance {
return { pageIndex };
}
}
// epub, snapshot
else if (this._type === 'epub') {
let cfi = item.getAttachmentLastPageIndex();
if (state) {
state.cfi = cfi;
return state;
}
else {
return { cfi };
}
}
// snapshot
else {
// let someProperty = item.getAttachmentSomeProperty();
// if (state) {

@ -1 +1 @@
Subproject commit 247e7b5cfd1e67db503a634556d5fcb57312d3d6
Subproject commit 4d674215617933746c8d5b3fce2cc85b67e3006e