Skip to content

Commit

Permalink
Do not load notyf resources unless notifications are enabled (#3958)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Oct 5, 2022
1 parent a5bd963 commit 52ca16a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions panel/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ def _set_thread_pool(self):
def _enable_notifications(self):
from .io.notifications import NotificationArea
from .io.state import state
from .reactive import ReactiveHTMLMetaclass
if self.notifications and 'notifications' not in ReactiveHTMLMetaclass._loaded_extensions:
ReactiveHTMLMetaclass._loaded_extensions.add('notifications')
if not state.curdoc:
state._notification = NotificationArea()

Expand Down
2 changes: 2 additions & 0 deletions panel/io/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class NotificationAreaBase(ReactiveHTML):
</div>
"""

_extension_name = 'notifications'

__abstract = True

def __init__(self, **params):
Expand Down

0 comments on commit 52ca16a

Please sign in to comment.