Sfoglia il codice sorgente

raise exception when setting visibility on notification or timer (fixes #3670)

Falko Schindler 8 mesi fa
parent
commit
e27064e9b6
2 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 3 0
      nicegui/elements/notification.py
  2. 3 0
      nicegui/elements/timer.py

+ 3 - 0
nicegui/elements/notification.py

@@ -196,3 +196,6 @@ class Notification(Element, component='notification.js'):
     def dismiss(self) -> None:
         """Dismiss the notification."""
         self.run_method('dismiss')
+
+    def set_visibility(self, visible: bool) -> None:
+        raise NotImplementedError('Use `dismiss()` to remove the notification. See #3670 for more information.')

+ 3 - 0
nicegui/elements/timer.py

@@ -128,3 +128,6 @@ class Timer(Element, component='timer.js'):
         if not self._deleted:
             assert self.parent_slot
             self.parent_slot.parent.remove(self)
+
+    def set_visibility(self, visible: bool) -> None:
+        raise NotImplementedError('Use `activate()`, `deactivate()` or `cancel()`. See #3670 for more information.')