more fixes
This commit is contained in:
@@ -1812,7 +1812,6 @@ class AppController:
|
||||
|
||||
def _cb_project_save(self) -> None:
|
||||
self._flush_to_project()
|
||||
self._save_active_project()
|
||||
self._flush_to_config()
|
||||
models.save_config(self.config)
|
||||
self._set_status("config saved")
|
||||
@@ -1828,7 +1827,6 @@ class AppController:
|
||||
self._set_status(f"project file not found: {path}")
|
||||
return
|
||||
self._flush_to_project()
|
||||
self._save_active_project()
|
||||
try:
|
||||
self.project = project_manager.load_project(path)
|
||||
self.active_project_path = path
|
||||
@@ -2006,7 +2004,8 @@ class AppController:
|
||||
def _save_active_project(self) -> None:
|
||||
if self.active_project_path:
|
||||
try:
|
||||
project_manager.save_project(self.project, self.active_project_path)
|
||||
cleaned = project_manager.clean_nones(self.project)
|
||||
project_manager.save_project(cleaned, self.active_project_path)
|
||||
except Exception as e:
|
||||
self._set_status(f"save error: {e}")
|
||||
|
||||
@@ -2324,6 +2323,9 @@ class AppController:
|
||||
else:
|
||||
mma_sec["active_track"] = None
|
||||
|
||||
cleaned_proj = project_manager.clean_nones(proj)
|
||||
project_manager.save_project(cleaned_proj, self.active_project_path)
|
||||
|
||||
def _flush_to_config(self) -> None:
|
||||
self.config["ai"] = {
|
||||
"provider": self.current_provider,
|
||||
@@ -2360,7 +2362,6 @@ class AppController:
|
||||
def _do_generate(self) -> tuple[str, Path, list[dict[str, Any]], str, str]:
|
||||
"""Returns (full_md, output_path, file_items, stable_md, discussion_text)."""
|
||||
self._flush_to_project()
|
||||
self._save_active_project()
|
||||
self._flush_to_config()
|
||||
models.save_config(self.config)
|
||||
track_id = self.active_track.id if self.active_track else None
|
||||
|
||||
Reference in New Issue
Block a user