fix(canvas): 画布 - 防止旧内容覆盖并支持版本历史恢复

This commit is contained in:
kinoko
2026-09-17 18:40:42 +08:00
parent 73a1d2bdfd
commit ba489323d7
69 changed files with 3575 additions and 294 deletions

View File

@@ -4,8 +4,9 @@ export type SyncProjectProgress = {
projectId: string;
total: number;
completed: number;
phase: "uploading" | "saving" | "done" | "error";
phase: "pending" | "uploading" | "saving" | "done" | "error" | "conflict";
message?: string;
draftCount?: number;
};
type SyncProgressStore = {
@@ -55,7 +56,7 @@ export const useSyncProgressStore = create<SyncProgressStore>((set, get) => ({
clearAll: () => set({ syncingProjects: {} }),
isAnySyncing: () => {
const list = Object.values(get().syncingProjects);
return list.some((item) => item.phase === "uploading" || item.phase === "saving");
return list.some((item) => item.phase !== "done");
},
}));