Added initial start for logging the users behaviour #104

Merged
cami merged 8 commits from feature/logging into main 2021-07-10 21:50:57 +00:00
Showing only changes of commit d576ebb404 - Show all commits

View file

@ -1,4 +1,4 @@
import React, { useState } from "react";
import React, { useEffect } from "react";
import Navbar from "./components/Navbar";
import "./App.css";
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
@ -17,11 +17,26 @@ import { useAuth } from "./auth/AuthProvider";
function App() {
let logger = new Logger({
inputs: ["cursor", "wheel", "keyboard", "touch"],
//inputs: ["cursor", "wheel", "keyboard", "touch"],
inputs: ["keyboard"],
logToConsole: true,
});
logger.init();
let [isLoggedIn] = useAuth();
useEffect(() => {
document.title = `${isLoggedIn}`;
console.log(isLoggedIn);
if (isLoggedIn === false) {
logger.stop();
console.log("stopped logger");
} else {
logger.start();
console.log("start logger");
}
});
return (
<>
<Router>