houston
houston copied to clipboard
Houston custom link to `/` without IronRouter is broken.
Houston custom link to / without IronRouter is broken. 1.Grab repo at https://github.com/AlexeyMK/repro-houston-bugs, 2. Run it (you'll need to create a Facebook app to work on localhost, sorry) - log in with FB. 3. Ensure that the non-admin stuff works (IE, you can move your character around) 4. Go to http://localhost:3000/admin/ and claim admin. 5. Click on 'Back to Game' link.
Expected: Sends us back to '/' Actual: IronRouter error and nothing happens. Speculation: need to define a default root to '/' for the IronRouter-less case.
I tried different things out but I got stuck. To fix this we would have to wrap the '/' route in a custom defined template which would then have to undo the magic we currently do with removing all stylesheets (how do we append them again?) + showing the html nodes again. I kinda wish there was an option where we could simply disable route checking from Iron-Router for special cases.
Also, in a way I don't feel that this is a bug, it's more or less another package checking the routes we defined, without us doing something wrong at any moment in the code.
I like that we care about people who just want to add packages and be able to work, but this would be kinda too hacky for me. wdyt? Do you know of any way to disable those errors?If not, I'll just create a ticket asking if there is any.
I think the easiest solution here is a hard link not wrapped by Router - something like window.location='/' (tested, that worked).
As a user, I don't understand why things are broken, though. We can special-case wrapping links to '/' inside custom links, but that feels almost more hacky than the previous solution. @gterrono, what do you think?
Window.location.replace('/')
works better and enables the "back" button. http://stackoverflow.com/a/8969975/2486953