File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
front/taskwizard-front/src/components Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,6 @@ const StartableTask = ({ task }: { task: TaskInterface }) => {
2020 const cancelRef = useRef ( null ) ;
2121 const toast = useToast ( ) ;
2222 const startedRef = useRef ( started ) ;
23- const setStartedRef = ( data : boolean ) => {
24- startedRef . current = data ;
25- setStarted ( data ) ;
26- } ;
2723 const handleCountChange = ( amount : string ) => {
2824 const amountNum = parseInt ( amount ) ;
2925 setCountAmount ( amountNum ) ;
@@ -72,7 +68,9 @@ const StartableTask = ({ task }: { task: TaskInterface }) => {
7268 const handleVisibilityChange = async ( ) => {
7369 if ( ! document . hidden ) {
7470 await stopTask ( task . id ) ;
75- handleStartedStateChange ( setStarted , false ) ;
71+ if ( startedRef ) {
72+ ( await startTask ( task . id ) ) ;
73+ }
7674 }
7775 } ;
7876 document . addEventListener ( 'visibilitychange' , handleVisibilityChange ) ;
You can’t perform that action at this time.
0 commit comments