diff --git a/pynecone/.templates/web/utils/state.js b/pynecone/.templates/web/utils/state.js index 5ec5332fc..356eb17d5 100644 --- a/pynecone/.templates/web/utils/state.js +++ b/pynecone/.templates/web/utils/state.js @@ -86,7 +86,7 @@ export const updateState = async ( router ); setResult({ - ...result, + processing: true, state: state, events: events, }); diff --git a/pynecone/config.py b/pynecone/config.py index ec46d28d2..32f4b0163 100644 --- a/pynecone/config.py +++ b/pynecone/config.py @@ -10,6 +10,9 @@ class Config(Base): # The name of the app. app_name: str + # The username. + username: Optional[str] = None + # The backend API url. api_url: str = "http://localhost:8000" diff --git a/pynecone/utils.py b/pynecone/utils.py index 3383d14e7..fc7ee4f5e 100644 --- a/pynecone/utils.py +++ b/pynecone/utils.py @@ -241,12 +241,7 @@ def get_config() -> Config: The app config. """ sys.path.append(os.getcwd()) - try: - return __import__(constants.CONFIG_MODULE).config - except: - print(f"No {constants.CONFIG_MODULE} module found.") - print("Using default config.") - return Config(app_name="") + return __import__(constants.CONFIG_MODULE).config def get_bun_path(): @@ -871,6 +866,6 @@ def get_redis(): return None redis_url, redis_port = config.redis_url.split(":") print("Using redis at", config.redis_url) - return redis.Redis(host=redis_url, port=redis_port, db=0) + return redis.Redis(host=redis_url, port=int(redis_port), db=0) except: return None