fix chapter nav for realsies

master
Drake 1 year ago
parent dd311ef468
commit e46cfb63bd

@ -15,6 +15,9 @@ export default async (params: URLSearchParams) => {
// chapters
if (params.get("chapter")) {
await story.chapters[Number(params.get("chapter") as string)].init();
console.log(story.chapters.length);
console.log(Number(params.get("chapter")));
return (
<Story story={story} stylepath="css/index.scss">
<div style="margin-left: 1em; margin-right: 1em;">
@ -48,8 +51,8 @@ export default async (params: URLSearchParams) => {
</a>
)}
&nbsp;|&nbsp;
{story.chapters.length <
Number(params.get("chapter")) ? undefined : (
{story.chapters.length ===
Number(params.get("chapter")) + 1 ? undefined : (
<a
href={(() => {
const tmpParams = params;

Loading…
Cancel
Save