Skip to content

Commit

Permalink
Prevent "are you sure you want to leave?" popup
Browse files Browse the repository at this point in the history
If the user clicks on the "Ask to join" button, they are trying to
abandon the form so we don't want to ask them if they want to preserve
the data previously entered.
  • Loading branch information
rmunn committed Aug 5, 2024
1 parent 5bf54e2 commit 66d11a4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
//random guid
let projectId:string = crypto.randomUUID();
let { form, errors, message, enhance, submitting } = lexSuperForm(formSchema, async () => {
let { form, errors, message, enhance, submitting, tainted } = lexSuperForm(formSchema, async () => {
const result = await _createProject({
id: projectId,
name: $form.name,
Expand Down Expand Up @@ -174,6 +174,7 @@
async function askToJoinProject(projectId: string, projectName: string): Promise<void> {
await _askToJoinProject(projectId);
notifySuccess($t('project.create.join_request_sent', { projectName }))
$tainted = undefined; // Prevent "are you sure you want to leave?" warning
await goto('/');
}
</script>
Expand Down

0 comments on commit 66d11a4

Please sign in to comment.