Merge pull request 'double click after registering (fix #121)' (#129) from survey/doubleclickprevention into main

Reviewed-on: #129
This commit is contained in:
cami 2021-07-11 00:42:28 +00:00
commit bf7af89c78
4 changed files with 16 additions and 7 deletions

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>