Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Random Idea Button doesn't fetch new idea when in "/random" already #40

Closed
wants to merge 1 commit into from

Conversation

tralwdwd
Copy link

fixes #39 by updating Layout.js to do a http redirect instead of changing location. This causes the retrieveRandomIdea function in random.js to run again and get a different idea.

@tralwdwd tralwdwd marked this pull request as draft November 13, 2024 16:46
@tralwdwd tralwdwd marked this pull request as ready for review November 13, 2024 17:05
fixes #39 by updating Layout.js to do a http redirect instead of changing location. This causes the retrieveRandomIdea function in random.js to run again and get a different idea.

Update Layout.js
@@ -159,7 +159,7 @@ const Layout = ({ children }) => {
<div className="navbar-end">
<div className="navbar-item">
<div className="buttons">
<Link href="/random" className="button is-default">
<Link className="button is-default" onClick={()=>window.location.replace("/random")}>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is somehow strange, because a href does actually the same thing... maybe it's because this is a next/link ...
Then there are probably some settings for this link, to enforce a reload

@bykof
Copy link
Owner

bykof commented Nov 17, 2024

I fixed this problem in the newest commit of what-to-code :) thank you for contribution!

@bykof bykof closed this Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Random idea button issue
2 participants