Skip to content

Commit

Permalink
webui: add confirmation dialog for logout
Browse files Browse the repository at this point in the history
  • Loading branch information
picoHz committed Mar 25, 2024
1 parent 93aa5e9 commit e37720d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion taxy-webui/src/components/navbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ pub fn navbar() -> Html {
let navigator_cloned = navigator.clone();
let logout_onclick = Callback::from(move |e: MouseEvent| {
e.prevent_default();
navigator_cloned.push(&Route::Logout);
if gloo_dialogs::confirm(&format!("Are you sure to log out?")) {
navigator_cloned.push(&Route::Logout);
}
});

let navigator_cloned = navigator.clone();
Expand Down

0 comments on commit e37720d

Please sign in to comment.