Fixed new submissions getting added to the downloaded submissions.

This commit is contained in:
Ajay Ramachandran
2019-12-13 21:55:43 -05:00
parent b34e6076e4
commit a5baebab3f
3 changed files with 31 additions and 22 deletions

View File

@@ -66,6 +66,24 @@ function localizeHtmlPage() {
}
}
function generateUserID(length = 36) {
let charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
let result = "";
if (window.crypto && window.crypto.getRandomValues) {
values = new Uint32Array(length);
window.crypto.getRandomValues(values);
for (i = 0; i < length; i++) {
result += charset[values[i] % charset.length];
}
return result;
} else {
for (let i = 0; i < length; i++) {
result += charset[Math.floor(Math.random() * charset.length)];
}
return result;
}
}
/**
* Gets the error message in a nice string
*