[Help] How to fix the "have to accept twice in order to have a tab change" issue?

https://perchance.org/a-plants-life

Hello, Vanilla here. I am the one who made the "A Plant's Life" generator.

There is an issue in this generator where you have to click the "Who's my gardener?" text, "Cool!" text, and the "Approve" button twice in order to make the brown box with text appear. This is strange, because there is a generator with the similar code that this generator is inspired by, and that generator doesn't have a similar issue. When you click the "Continue" button after choosing a deputy and medicine cat, it will show you a box with an image and white text in it, along with the clan event log, instead of having the annoying issue where you have to choose deputy and medicine cats and click the "Continue" button again.

I am not sure if this is a bug, but I find this strange, because of the other generator. Can anybody please provide the code/feedback to fix that for me? Thanks.

2 points · 4 comments · view on lemmy.world

4 Comments

VioneT@lemmy.world · 1 pts · 1y (3 replies)

I've checked the code and on the button on the approve list, you need to increment the click and set the continue variable before updating. It needs double update since you 'update' it first then set the appropriate values to the variables.

VanillaFlower@lemmy.world · 1 pts · 1y (2 replies)

What do you mean by "update?" Do you mean the function of button, changing using goto plugin, or function to save the generator's updates? /nm /nf /nav /genq

VioneT@lemmy.world · 1 pts · 1y (1 reply)

This button:

<button onclick="update(), click++">Approve</button>

You should set the variables first before the update() e.g.

<button onclick="click++, update()">Approve</button>
VanillaFlower@lemmy.world · 1 pts · 1y

Thanks for helping me!