From 47cae849ff9dd8a30a31991d75a7ee8264e0a37e Mon Sep 17 00:00:00 2001 From: Brian Bjarke Jensen Date: Sat, 24 Feb 2024 21:54:36 +0100 Subject: [PATCH] added env dependent storage type --- src/web/layout/stores.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/web/layout/stores.py b/src/web/layout/stores.py index 40f40e9..7345d8b 100644 --- a/src/web/layout/stores.py +++ b/src/web/layout/stores.py @@ -1,9 +1,16 @@ from dash import html, dcc +import logging +import os +storage_type = "session" +if "ENV" in os.environ and os.getenv("ENV") == "DEV": + storage_type = "memory" + logging.info(f"ENV=DEV -> dcc.Stores changed to storage_type={storage_type}") + stores_element = html.Div( children=[ - dcc.Store(id="alert-message", storage_type="session"), - dcc.Store(id="visual-communication-name", storage_type="session"), + dcc.Store(id="alert-message", storage_type=storage_type, data=""), + dcc.Store(id="vis-com-name", storage_type=storage_type, data=""), ] ) \ No newline at end of file