Skip to content

Commit

Permalink
Show snackbar message on scene_activated
Browse files Browse the repository at this point in the history
  • Loading branch information
YeonV committed Jan 18, 2025
1 parent dbd0f1b commit de3c32c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ export default function App() {
}
}, [showSnackbar])

useEffect(() => {
const handleWebsockets = (e: any) => {
showSnackbar('info', 'Scene activated: ' + e.detail.scene_id)
}
document.addEventListener('scene_activated', handleWebsockets)
return () => {
document.removeEventListener('scene_activated', handleWebsockets)
}
}, [showSnackbar])

useEffect(() => {
if (protoCall !== '') {
// showSnackbar('info', `External call: ${protoCall}`)
Expand Down

0 comments on commit de3c32c

Please sign in to comment.