Skip to content

Commit 81997d1

Browse files
authored
fix(automations): clear stale scheduler install gate (anomalyco#1461)
1 parent f516efc commit 81997d1

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎apps/app/src/app/pages/automations.tsx‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,12 @@ export default function AutomationsView(props: AutomationsViewProps) {
441441
onCleanup(() => window.clearInterval(interval));
442442
});
443443

444+
createEffect(() => {
445+
if (props.schedulerInstalled) {
446+
setSchedulerInstallRequested(false);
447+
}
448+
});
449+
444450
const showToast = (title: string, tone: AppStatusToastTone = "info") => {
445451
statusToasts.showToast({ title, tone });
446452
};
@@ -551,6 +557,12 @@ export default function AutomationsView(props: AutomationsViewProps) {
551557
try {
552558
await Promise.resolve(props.addPlugin("opencode-scheduler"));
553559
showToast(t("scheduled.scheduler_install_requested"), "success");
560+
} catch (error) {
561+
setSchedulerInstallRequested(false);
562+
showToast(
563+
error instanceof Error ? error.message : t("scheduled.prepare_error_fallback"),
564+
"error",
565+
);
554566
} finally {
555567
setInstallingScheduler(false);
556568
}

0 commit comments

Comments
 (0)