Quellcode durchsuchen

#1477: check if one-shot timer is active before executing callback

Falko Schindler vor 1 Jahr
Ursprung
Commit
598b8051b7
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      nicegui/functions/timer.py

+ 1 - 1
nicegui/functions/timer.py

@@ -54,7 +54,7 @@ class Timer:
             assert self.slot is not None
             with self.slot:
                 await asyncio.sleep(self.interval)
-                if globals.state not in {globals.State.STOPPING, globals.State.STOPPED}:
+                if self.active and globals.state not in {globals.State.STOPPING, globals.State.STOPPED}:
                     await self._invoke_callback()
         finally:
             self._cleanup()