-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(admin): better validation for uploaded games #162
Conversation
take the same new game validator and put it on the admin page to validate uploaded games as well Improve the json parse error to include the actual error on parse
Fixes: #5 |
The example image looks bad, is the newline not newlining? 😅 Also could you please provide the faulty |
Yeah lol it's not doing a new lines job Here is an example json file that should trigger about 4 errors |
@karlromets pushed a fix. Now looks like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, however due to the error timeout being 5s, the game file error disappears after 5 seconds. This is pretty bad user experience e.g. for slow readers.
Issue comes from this function with a timeout:
function setError(e) {
setErrorVal(e);
console.error(e);
setTimeout(() => {
setErrorVal("");
}, 5000);
}
Yeah, Ill go ahead and double it |
Fixes: #5
take the same new game validator and put it on the admin page to validate uploaded games as well
Improve the json parse error to include the actual error on parse