fix(app): transition draft project updates (#34252)

This commit is contained in:
Brendan Allan 2026-06-28 02:58:07 +08:00 committed by GitHub
commit ae53163cad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -173,10 +173,12 @@ export const { use: useTabs, provider: TabsProvider } = createSimpleContext({
})
},
updateDraft(draftID: string, draft: Partial<Omit<DraftTab, "type" | "draftID">>) {
setStore(
(tab) => tab.type === "draft" && tab.draftID === draftID,
produce((tab) => Object.assign(tab, draft)),
)
void startTransition(() => {
setStore(
(tab) => tab.type === "draft" && tab.draftID === draftID,
produce((tab) => Object.assign(tab, draft)),
)
})
},
promoteDraft(draftID: string, session: Omit<SessionTab, "type">) {
// Keep the replacement and navigation atomic so /new-session never renders