refactor(order): add transition evaluator and timer constants

This commit is contained in:
zetaloop
2026-02-23 11:03:31 +08:00
parent 03fa447864
commit 6517018a9c
6 changed files with 188 additions and 8 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
import { create } from "zustand"
import { DISPUTE_TO_RESOLVED_MS, DISPUTE_TO_REVIEWING_MS } from "@/lib/config/demo-timers"
import { generateId } from "@/lib/id"
import { mockDisputes } from "@/lib/mock"
import type { Dispute } from "@/lib/types"
@@ -108,7 +109,7 @@ export const useDisputeStore = create<DisputeState>((set, get) => {
}
}),
}))
}, 5000)
}, DISPUTE_TO_REVIEWING_MS)
const toResolved = setTimeout(() => {
set((state) => ({
@@ -133,7 +134,7 @@ export const useDisputeStore = create<DisputeState>((set, get) => {
}),
}))
clearProgressTimers(disputeId)
}, 10000)
}, DISPUTE_TO_RESOLVED_MS)
progressTimers.set(disputeId, [toReviewing, toResolved])
}