Skip to content

Commit

Permalink
fix #86
Browse files Browse the repository at this point in the history
  • Loading branch information
FrameMuse committed Mar 29, 2023
1 parent b6e84b7 commit 4ec78e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ export class ModalController {
* - Controls whether the order of windows.
*/
private add(modalWindow: ModalWindow) {
// Skip adding to queue if the window is already in the beginning of the queue.
const lastWindow = [...this.windows].at(-1)
if (lastWindow?.id === modalWindow.id) {
return
}

// If there are temporary modal windows, clear.
if (this.isOpen === false && this.windows.size > 0) {
this.windows.clear()
Expand Down

0 comments on commit 4ec78e0

Please sign in to comment.