fix chapter nav for realsies

master
Drake 1 year ago
parent dd311ef468
commit e46cfb63bd

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

Loading…
Cancel
Save