double click after registering (fix #121) #129

Merged
cami merged 1 commit from survey/doubleclickprevention into main 2021-07-11 00:42:29 +00:00
4 changed files with 16 additions and 7 deletions
Showing only changes of commit e934ae98ec - Show all commits

View file

@ -13,8 +13,11 @@ import Secret from "./components/pages/Secret";
import Umfrage from "./components/pages/Umfrage";
import PrivateRoute from "./auth/PrivateRoute";
import Behavior from "./components/pages/Behavior";
import { useAuth } from "./auth/AuthProvider";
function App() {
const [isLoggedIn] = useAuth();
isLoggedIn ? (document.title = isLoggedIn) : document.title = isLoggedIn;
return (
<>
<Router>

View file

@ -8,7 +8,7 @@ export default function Behavior() {
let logger = new Logger({
//inputs: ["cursor", "wheel", "keyboard", "touch"],
inputs: ["keyboard"],
logToConsole: true,
// logToConsole: true,
});
logger.init();
@ -19,10 +19,10 @@ export default function Behavior() {
console.log(isLoggedIn);
if (isLoggedIn === false) {
logger.stop();
console.log("stopped logger");
//console.log("stopped logger");
} else {
logger.start();
console.log("start logger");
// console.log("start logger");
}
});
return (

View file

@ -34,7 +34,7 @@ export default function Umfrage() {
const [isSkillsOk, setIsSkillsOk] = useState("");
/* genereal check if survey is valid */
const [isSurveyValid, setIsSurveyValid] = useState("");
const [isSurveyValid, setIsSurveyValid] = useState(true);
const onSubmitClick = (e) => {
e.preventDefault();
@ -49,11 +49,14 @@ export default function Umfrage() {
setIsGenderOk(true);
setIsEducationOk(true);
setIsSkillsOk(true);
setIsSurveyValid(true);
console.log("before valid");
console.log(isSurveyValid);
if (!Number(age)) {
setAgeErrorMessage("Das Alter muss als Zahl angegeben werden.");
setIsSurveyValid(false);
setIsAgeOk(false);
//setIsSurveyValid(false);
// setIsAgeOk(false);
}
if (gender === "DEFAULT" || gender === "") {
setGenderErrorMessage(
@ -77,7 +80,8 @@ export default function Umfrage() {
setIsSkillsOk(false);
}
setIsSurveyValid(true);
console.log("after valid");
console.log(isSurveyValid);
if (isSurveyValid === true) {
authFetch("/api/protected/umfrage", {
method: "post",

View file

@ -13,6 +13,8 @@ export default function Lizenzen() {
Bildnachweise notiert werden.
</p>
<h2>Verwendete Bibliotheken</h2>
<h3>Backend</h3>
<h3>Frontend</h3>
<h2>Bildnachweise</h2>
<ul className="bildnachweise">
<li>