Added a confirmation when generating codes
This commit is contained in:
@@ -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));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user