浏览代码

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

Falko Schindler 8 月之前
父节点
当前提交
e27064e9b6
共有 2 个文件被更改,包括 6 次插入0 次删除
  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.')