Skip to content

Duplicate modals stacking when openModal fires repeatedly #239

@Huygon764

Description

@Huygon764

Problem:
The same modal can be opened multiple times and stack on top of itself:

  • ModalLayout.openModal has no guard against duplicates — if two callers
    (double-click, race, effect re-run) call openModal("x") before the first
    instance closes, two instances of x are pushed into activeModals.
  • useCommitmentGuard's effect re-runs while walletClient.account && !commitment && !isAuthenticated stays true, firing
    openModal("generateCommitment") repeatedly and producing overlapping
    generate-commitment modals.

Expectation:

  • At most one modal instance per modal name is active at a time; repeated
    openModal(sameName) calls are no-ops while an instance is already open.
  • Guard hooks fire openModal once per eligibility transition and reset after
    the user becomes ineligible (commitment created, logged in, or wallet
    disconnected).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions