Skip to content

Commit

Permalink
raise exception when setting visibility on notification or timer (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Sep 6, 2024
1 parent 0ae841e commit e27064e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nicegui/elements/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,6 @@ def on_dismiss(self, callback: Callable[..., Any]) -> Self:
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 changes: 3 additions & 0 deletions nicegui/elements/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ def _cleanup(self) -> None:
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.')

0 comments on commit e27064e

Please sign in to comment.