Skip to content
Snippets Groups Projects
Commit 345551ea authored by brunoravera's avatar brunoravera
Browse files

fix

parent a01d58fb
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,7 @@ export const Topbar: React.FC = () => { ...@@ -64,6 +64,7 @@ export const Topbar: React.FC = () => {
const listener = (message) => { const listener = (message) => {
const reportMessage = JSON.parse(message.data as string) as ReportMessage const reportMessage = JSON.parse(message.data as string) as ReportMessage
if (store.isRunning) {
match(reportMessage) match(reportMessage)
.with( .with(
{ status: 'SUCCESS', reportId: P.not(P.nullish) }, { status: 'SUCCESS', reportId: P.not(P.nullish) },
...@@ -81,11 +82,12 @@ export const Topbar: React.FC = () => { ...@@ -81,11 +82,12 @@ export const Topbar: React.FC = () => {
store.setIsRunning(false) store.setIsRunning(false)
}) })
} }
}
channel.subscribe('event', listener) channel.subscribe('event', listener)
return () => channel.unsubscribe('event', listener) return () => channel.unsubscribe('event', listener)
}, []) }, [store.isRunning])
const handleOnBack = () => { const handleOnBack = () => {
if (pathname === '/') { if (pathname === '/') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment