Skip to content

Commit

Permalink
fix: sign up captcha challenge appearing under the modal, making it i…
Browse files Browse the repository at this point in the history
…mpossible to sign up
  • Loading branch information
Miodec committed Mar 14, 2024
1 parent c3671fb commit 3a012bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontend/src/ts/modals/register-captcha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export let promise = new Promise<string | undefined>((resolve) => {

export function show(): void {
void modal.show({
mode: "dialog",
beforeAnimation: async (modal) => {
promise = new Promise((resolve) => {
resolvePromise = resolve;
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/ts/utils/animated-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type ShowHideOptions = {
};

export type ShowOptions = ShowHideOptions & {
mode?: "modal" | "dialog";
focusFirstInput?: true | "focusAndSelect";
modalChain?: AnimatedModal;
};
Expand Down Expand Up @@ -199,7 +200,11 @@ export default class AnimatedModal {
}

this.open = true;
this.wrapperEl.showModal();
if (options?.mode === "dialog") {
this.wrapperEl.show();
} else if (options?.mode === "modal" || options?.mode === undefined) {
this.wrapperEl.showModal();
}

//wait until the next event loop to allow the dialog to start animating
setTimeout(async () => {
Expand Down

0 comments on commit 3a012bd

Please sign in to comment.