Skip to content

Commit

Permalink
Handle state.template when no session is active
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jun 7, 2021
1 parent 865f2c5 commit afad8ca
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions panel/io/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class _state(param.Parameterized):

# Templates
_templates = WeakKeyDictionary() # Server templates indexed by document
_template = None

# An index of all currently active views
_views = {}
Expand Down Expand Up @@ -353,9 +354,13 @@ def session_args(self):
def template(self):
from ..config import config
if self.curdoc in self._templates:
template = self._templates[self.curdoc]
return self._templates[self.curdoc]
elif self.curdoc is None and self._template:
return self._template
template = config.template(theme=config.theme)
if self.curdoc is None:
self._template = template
else:
template = config.template(theme=config.theme)
self._templates[self.curdoc] = template
return template

Expand Down

0 comments on commit afad8ca

Please sign in to comment.