fix: Prevent double dialog open (Closes #21)
1 file changed, 6 insertions(+), 2 deletions(-)
changed files
M frontend/static/search.js → frontend/static/search.js
@@ -322,9 +322,13 @@ if (ev.ctrlKey || ev.metaKey) { ev.preventDefault(); window.open(detailURL(ev.target.href), "_blank"); } else if (!(ev.shiftKey || ev.altKey)) { - pageHistory.pushDetail(ev.target.href); - getDetail(new URL(ev.target.href)); ev.preventDefault(); + if (dialog.open || handleDialogOpen.pending) return; + handleDialogOpen.pending = true; + pageHistory.pushDetail(ev.target.href); + getDetail(new URL(ev.target.href)).finally(() => { + handleDialogOpen.pending = false; + }); } }