fix: leave published component choices alone when state.json cannot be read

This commit is contained in:
maxjivi05 authored and MaxsTechReview committed 2026-10-27 00:07:45 -04:00
1 parent c781cfd525
commit c25d54aced
2 files changed
+16

No files matched your search

@@ -175,6 +175,9 @@ object ComponentsManager {
}
fun republish(context: Context): Boolean = synchronized(lock) {
recoverState(context)
val saved = stateFile(context)
if (saved.exists() && runCatching { JSONObject(saved.readText()) }.isFailure) return false
val state = loadState(context)
val prepared = prepareLaunchState(context, state)
if ((FileUtils.readString(File(launchDir(context), "desired.tsv")) ?: "") == prepared.text) return false