Skip to content

Commit d2d0642

Browse files
authored
Ensure state._notification_type is used in notebook (#7872)
* Ensure state._notification_type is used in notebook * Small fix
1 parent 6e9be1a commit d2d0642

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

panel/config.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,14 @@ def _set_thread_pool(self):
357357

358358
@param.depends('notifications', watch=True)
359359
def _setup_notifications(self):
360-
from .io.notifications import NotificationArea
361-
from .reactive import ReactiveHTMLMetaclass
362-
if self.notifications and 'notifications' not in ReactiveHTMLMetaclass._loaded_extensions:
363-
ReactiveHTMLMetaclass._loaded_extensions.add('notifications')
360+
if state._notification_type is None:
361+
from .io.notifications import NotificationArea
362+
from .reactive import ReactiveHTMLMetaclass
363+
state._notification_type = NotificationArea
364+
if self.notifications and 'notifications' not in ReactiveHTMLMetaclass._loaded_extensions:
365+
ReactiveHTMLMetaclass._loaded_extensions.add('notifications')
364366
if not state.curdoc:
365-
state._notification = NotificationArea()
367+
state._notification = state._notification_type()
366368

367369
@param.depends('disconnect_notification', 'ready_notification', watch=True)
368370
def _enable_notifications(self):

0 commit comments

Comments
 (0)