Skip to content

Commit

Permalink
removed request_animation_frame
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptistemontan committed Nov 11, 2024
1 parent de2a7ca commit 5e2025c
Showing 1 changed file with 17 additions and 25 deletions.
42 changes: 17 additions & 25 deletions leptos_i18n/src/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,18 +241,14 @@ fn update_path_effect<L: Locale>(

let navigate = navigate.clone();

// TODO FIXME: see https://github.com/leptos-rs/leptos/issues/2979
// It works for now, but it is not ideal.
request_animation_frame(move || {
navigate(
&new_path,
NavigateOptions {
resolve: false,
scroll: false,
..Default::default()
},
);
});
navigate(
&new_path,
NavigateOptions {
resolve: false,
scroll: false,
..Default::default()
},
);

new_locale
}
Expand Down Expand Up @@ -293,19 +289,15 @@ fn correct_locale_prefix_effect<L: Locale>(

i18n.set_locale(new_locale);

// TODO FIXME: see https://github.com/leptos-rs/leptos/issues/2979
// It works for now, but it is not ideal.
request_animation_frame(move || {
navigate(
&new_path,
NavigateOptions {
resolve: false,
replace: true,
scroll: false,
..Default::default()
},
);
});
navigate(
&new_path,
NavigateOptions {
resolve: false,
replace: true,
scroll: false,
..Default::default()
},
);
}
}

Expand Down

0 comments on commit 5e2025c

Please sign in to comment.