Skip to content

Commit

Permalink
Fix html5 preview to honor entry option.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtibbles committed Jan 7, 2025
1 parent e78bd3c commit 016f3f4
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

<script>
import get from 'lodash/get';
import uniqBy from 'lodash/uniqBy';
import sortBy from 'lodash/sortBy';
import { mapGetters } from 'vuex';
Expand Down Expand Up @@ -99,6 +100,10 @@
},
computed: {
...mapGetters('file', ['getContentNodeFileById', 'getContentNodeFiles']),
...mapGetters('contentNode', ['getContentNode']),
contentNode() {
return this.getContentNode(this.nodeId);
},
file() {
return this.getContentNodeFileById(this.nodeId, this.fileId);
},
Expand Down Expand Up @@ -129,7 +134,8 @@
return this.file.file_format === 'epub';
},
htmlPath() {
return `/zipcontent/${this.file.checksum}.${this.file.file_format}`;
const entry = get(this.contentNode, ['extra_fields', 'options', 'entry'], 'index.html');
return `/zipcontent/${this.file.checksum}.${this.file.file_format}/${entry}`;
},
src() {
return this.file && this.file.url;
Expand Down

0 comments on commit 016f3f4

Please sign in to comment.