Adding disk mount handling to React UI.
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Controller Tests / controller-tests (push) Waiting to run
Jest Tests / jest-tests (push) Waiting to run

This commit is contained in:
Roland 2025-12-16 15:06:41 -07:00
parent 1a02a4eb5b
commit 628b9f3096
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
10 changed files with 600 additions and 51 deletions

View file

@ -103,6 +103,7 @@ def save_config() -> None:
"""
Save current runtime config to the WROLPi drive.
Only saves the diff from defaults to keep the file clean.
If config matches defaults, removes the config file.
"""
if not is_primary_drive_mounted():
raise RuntimeError("Cannot save config: primary drive not mounted")
@ -111,7 +112,9 @@ def save_config() -> None:
diff = _get_config_diff(_runtime_config, DEFAULT_CONFIG)
if not diff:
# Nothing to save - config matches defaults
# Config matches defaults - remove config file if it exists
if CONFIG_PATH_ON_DRIVE.exists():
CONFIG_PATH_ON_DRIVE.unlink()
return
CONFIG_PATH_ON_DRIVE.parent.mkdir(parents=True, exist_ok=True)