mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-21 00:02:30 +00:00
fix: close only the drawer opening whose draft discard was awaited
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ViTUkt4czrvZdxdWwxqRAQ
This commit is contained in:
co-authored by
Claude Opus 5
parent
db791f0493
commit
c51a932eed
@@ -176,8 +176,12 @@
|
||||
getDeployed={() => resourceEditor?.localDraftDeployed()}
|
||||
getCurrent={() => resourceEditor?.localDraftCurrent()}
|
||||
onDiscard={async () => {
|
||||
// A draft-only resource is its draft: discarding it leaves nothing to show.
|
||||
if (await resourceEditor?.discardLocalDraft()) drawer?.closeDrawer()
|
||||
// A draft-only resource is its draft: discarding it leaves nothing to show. Close
|
||||
// only the opening that asked for it — the discard is awaited, and another resource
|
||||
// may have been opened over this drawer in the meantime.
|
||||
const opening = session
|
||||
if ((await resourceEditor?.discardLocalDraft()) && session === opening)
|
||||
drawer?.closeDrawer()
|
||||
}}
|
||||
disabled={!canWriteSelected}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user