fix: let the repair screen turn the layout plugin back on

This commit is contained in:
LukeGus committed 2026-10-21 11:55:50 -05:00
1 parent 28cb1bc554
commit 53c4e5fe9c
5 files changed
+59 -2

No files matched your search

+12
View File
@@ -81,6 +81,18 @@ function AdminTools({
})}
</Button>
)}
{entry?.installed && !entry.enabled && (
<Button
size="sm"
onClick={() => void manager.toggle(entry).then(onRetry)}
disabled={manager.busy.has(entry.id)}
>
<Power />
{status.reason === "disabled"
? t("looks.repair.enable", { name: entry.name })
: t("looks.repair.startAgain", { name: entry.name })}
</Button>
)}
{entry?.installed && entry.enabled && !entry.managedByServer && (
<Button
size="sm"
+3 -1
View File
@@ -79,13 +79,15 @@ export function layoutStatus(input: LayoutStatusInput): LayoutStatus {
const owner = input.owner;
if (!owner) return repair("missing");
const summary = owner.summary;
if (!summary.enabled) return repair("disabled");
// Before the enabled check: the server reports a plugin that failed to
// start as not enabled, which hid the real error behind "turned off".
if (owner.frontend === "blocked" || summary.state === "blocked") {
return repair("blocked", { error: owner.error ?? summary.lastError });
}
if (owner.frontend === "failed" || summary.state === "failed") {
return repair("failed", { error: owner.error ?? summary.lastError });
}
if (!summary.enabled) return repair("disabled");
if (owner.frontend === "loading") return { kind: "loading" };
// Just chosen: the runtime is about to load its code.
if (