Added a confirmation when generating codes

This commit is contained in:
Tiago Ribeiro
2024-01-25 11:32:29 +00:00
parent c38c1d9ff6
commit a969e90c98

View File

@@ -95,6 +95,8 @@ export default function BatchCodeGenerator({user}: {user: User}) {
}, [filesContent]); }, [filesContent]);
const generateCode = (type: Type) => { const generateCode = (type: Type) => {
if (!confirm(`You are about to generate ${infos.length} codes, are you sure you want to continue?`)) return;
const uid = new ShortUniqueId(); const uid = new ShortUniqueId();
const codes = infos.map(() => uid.randomUUID(6)); const codes = infos.map(() => uid.randomUUID(6));