diff --git a/crates/app/src/public/html/profile/settings.lisp b/crates/app/src/public/html/profile/settings.lisp index feee345..e55662d 100644 --- a/crates/app/src/public/html/profile/settings.lisp +++ b/crates/app/src/public/html/profile/settings.lisp @@ -578,7 +578,7 @@ document.getElementById(\"invite_codes_output\").classList.remove(\"hidden\"); document.getElementById(\"invite_codes_error_output\").classList.remove(\"hidden\"); - document.getElementById(\"invite_codes_output\").children[0].innerText = \"Working...\"; + document.getElementById(\"invite_codes_output\").children[0].innerText = \"Working... expect to wait 50ms per invite code\"; fetch(`/api/v1/invites/${count}`, { method: \"POST\", diff --git a/crates/app/src/routes/api/v1/auth/profile.rs b/crates/app/src/routes/api/v1/auth/profile.rs index f8691bb..be550e2 100644 --- a/crates/app/src/routes/api/v1/auth/profile.rs +++ b/crates/app/src/routes/api/v1/auth/profile.rs @@ -855,6 +855,8 @@ pub async fn generate_invite_codes_request( let mut errors_string = String::new(); for _ in 0..count { + // ids will quickly collide, so we need to wait a bit so timestamps are different + tokio::time::sleep(Duration::from_millis(50)).await; match data .create_invite_code(InviteCode::new(user.id), &user) .await