Skip to content

Commit

Permalink
Only redirect if streamKey != ''
Browse files Browse the repository at this point in the history
Before hitting publish/subscribe in index page would redirect users to
invalid page.
  • Loading branch information
Sean-Der committed Apr 12, 2024
1 parent aeb4043 commit 7f80829
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions web/src/components/selection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ function Selection(props) {
setStreamKey(e.target.value)
}
const onWatchStreamClick = () => {
navigate(`/${streamKey}`)
if (streamKey !== '') {
navigate(`/${streamKey}`)
}
}

const onPublishStreamClick = () => {
navigate(`/publish/${streamKey}`)
if (streamKey !== '') {
navigate(`/publish/${streamKey}`)
}
}

return (
Expand Down

0 comments on commit 7f80829

Please sign in to comment.