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

Houston custom link to / without IronRouter is broken. #167

Open
AlexeyMK opened this issue Apr 26, 2014 · 3 comments
Open

Houston custom link to / without IronRouter is broken. #167

AlexeyMK opened this issue Apr 26, 2014 · 3 comments
Assignees

Comments

@AlexeyMK
Copy link
Collaborator

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.

@matteodem
Copy link
Contributor

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.

@AlexeyMK
Copy link
Collaborator Author

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?

@jasonszhao
Copy link

Window.location.replace('/') works better and enables the "back" button. http://stackoverflow.com/a/8969975/2486953

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants