refactor: replace Toast with Sonner

This commit is contained in:
tao.chen
2026-08-26 14:06:12 +08:00
parent f99b543100
commit d7f3db1cc4
18 changed files with 126 additions and 320 deletions
@@ -3,7 +3,7 @@
import { ApiRequestError, type Schedule, type ScheduleNode, type WorkspaceBoundApi } from "../../../services/api";
import { useScriptWorkspaceStore } from "../../platform/state/scriptWorkspaceStore";
import { useUiStore } from "../../platform/state/uiStore";
import { toast } from "sonner";
import type { NodeForm, NodePositionDraft, Notice, ScheduleForm } from "./types";
import type { SchedulesStore } from "./useSchedulesStore";
@@ -22,7 +22,9 @@ export function requireApi(): WorkspaceBoundApi {
}
export function notify(notice: Notice): void {
useUiStore.getState().pushToast(notice);
if (notice.tone === "error") toast.error(notice.message);
else if (notice.tone === "info") toast.info(notice.message);
else toast.success(notice.message);
}
export function setApiOnline(online: boolean): void {