working on improving component loading
This commit is contained in:
@@ -115,11 +115,18 @@ class TabsManager(MultipleInstance):
|
||||
def _dynamic_get_content(self, tab_id):
|
||||
if tab_id not in self._state.tabs:
|
||||
return Div("Tab not found.")
|
||||
|
||||
tab_config = self._state.tabs[tab_id]
|
||||
if tab_config["component"] is None:
|
||||
return Div("Tab content does not support serialization.")
|
||||
|
||||
res = InstancesManager.get(self._session, tab_config["component"][1], None)
|
||||
if res is not None:
|
||||
return res
|
||||
|
||||
try:
|
||||
return InstancesManager.get(self._session, tab_config["component"][1])
|
||||
logger.debug(f"Component not created yet. Need to manually create it.")
|
||||
return InstancesManager.dynamic_get(self._session, tab_config["component_parent"], tab_config["component"])
|
||||
except Exception as e:
|
||||
logger.error(f"Error while retrieving tab content: {e}")
|
||||
return Div("Failed to retrieve tab content.")
|
||||
|
||||
Reference in New Issue
Block a user