Skip to content

Commit

Permalink
feat: navigate to qr code page on upload
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbchron committed Feb 26, 2024
1 parent 36ed84e commit 50d3920
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/site-app/src/components/photo_upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ pub fn PhotoUpload() -> impl IntoView {
});
let pending = upload_action.pending();
let value = upload_action.value();
let successful = move || matches!(value(), Some(Ok(_)));

create_effect(move |_| {
if successful() {
crate::components::navigation::reload();
if let Some(Ok(id)) = value() {
// redirect to the qr code page
let url = format!("/qr/{}", id.0);
crate::components::navigation::navigate_to(&url);
}
});

Expand Down

0 comments on commit 50d3920

Please sign in to comment.