-
Notifications
You must be signed in to change notification settings - Fork 156
Routes don't behave like expected #247
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
Comments
Could you please post your |
fn routes(url: Url) -> Msg {
Msg::Route(url)
}
#[derive(Debug, Clone)]
enum Msg {
Route(Url),
}
fn update(msg: Msg, model: &mut Model, _: &mut impl Orders<Msg>) {
match msg {
Msg::Route(url) => {
model.url = Some(url);
}
}
model.count += 1;
} |
I think the problem is that I'm looking for a hashchange event that is not tracked by seed. |
@flosse A little bit OT - I haven't enountered this problem because I don't use |
Could you also post the code that triggers the routing? eg the update func section or listened-link. |
We consider to port the whole kartevonmorgen frontend to seed. |
As already mentioned, here is the complete example: flosse@5dee829#diff-1015f606e4bbeb299d9ce5d5d8303123 but there is no code that triggers the routing, I just change the hash within the address bar. |
The issue here is that the routing system requires something to trigger the routing, like I'm trying to think if there's a way to make this work. Perhaps there's a way to listen for url changes like we listen for |
thanks! Changing the hash leads to the following URL:
And the route function gets called twice. code: flosse@8a6749a |
How about now? I'm not sure how/if to handle routing being called twice. |
now it's working :)
the |
The popstate handler creates an empty url if |
Latest push should do it. Ready to merge if this is solved on your end. Popstate will no longer call the routes function if it receives a null JS value, as it does here. (Previous behavior was to call with an empty Url, as you found out.) |
@flosse Was this fixed? Just pinging for a confirmation. |
@AlterionX it should be fixed - #252 (comment) |
yes, as far as I can remember :) |
Using seed v0.4.1 I tried to use URL changes but it does not work:
Here is the code: flosse@5dee829#diff-1015f606e4bbeb299d9ce5d5d8303123
Is this a bug or a feature?
The text was updated successfully, but these errors were encountered: