Rodja Trappe 2 years ago
parent
commit
c0624806fb
2 changed files with 1 additions and 2 deletions
  1. 1 0
      nicegui/functions/timer.py
  2. 0 2
      tests/test_element.py

+ 1 - 0
nicegui/functions/timer.py

@@ -50,6 +50,7 @@ class Timer:
                 if self.slot.parent.client.id not in globals.clients:
                     break
                 if not self.slot.parent.client.shared:
+                    # NOTE: we need to wait for the client before state can be further manipulated (see https://github.com/zauberzeug/nicegui/issues/206)
                     await self.slot.parent.client.handshake()
                 try:
                     start = time.time()

+ 0 - 2
tests/test_element.py

@@ -139,7 +139,5 @@ def test_setting_visibility_in_timer(screen: Screen):
         ui.timer(1, lambda: label.set_visibility(False))
 
     screen.open('/')
-    # assert not label.visible
-    # assert 'hidden' in label._classes
     screen.wait(0.5)
     screen.should_not_contain('Some Label')