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
Loading
...@@ -64,28 +64,30 @@ export const Topbar: React.FC = () => { ...@@ -64,28 +64,30 @@ 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
match(reportMessage) if (store.isRunning) {
.with( match(reportMessage)
{ status: 'SUCCESS', reportId: P.not(P.nullish) }, .with(
({ reportId }) => { { status: 'SUCCESS', reportId: P.not(P.nullish) },
({ reportId }) => {
store.setIsRunning(false)
renderSuccessReportToast(reportId)
}
)
.otherwise(() => {
toast({
status: 'error',
duration: 9000,
title: capitalize(t('new_report_error')),
})
store.setIsRunning(false) store.setIsRunning(false)
renderSuccessReportToast(reportId)
}
)
.otherwise(() => {
toast({
status: 'error',
duration: 9000,
title: capitalize(t('new_report_error')),
}) })
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.
Finish editing this message first!
Please register or to comment