Added further things for logging user interaction
This commit is contained in:
parent
21b97467aa
commit
d576ebb404
1 changed files with 17 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
import React, { useState } from "react";
|
import React, { useEffect } from "react";
|
||||||
import Navbar from "./components/Navbar";
|
import Navbar from "./components/Navbar";
|
||||||
import "./App.css";
|
import "./App.css";
|
||||||
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
|
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
|
||||||
|
@ -17,11 +17,26 @@ import { useAuth } from "./auth/AuthProvider";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
let logger = new Logger({
|
let logger = new Logger({
|
||||||
inputs: ["cursor", "wheel", "keyboard", "touch"],
|
//inputs: ["cursor", "wheel", "keyboard", "touch"],
|
||||||
|
inputs: ["keyboard"],
|
||||||
logToConsole: true,
|
logToConsole: true,
|
||||||
});
|
});
|
||||||
logger.init();
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<Router>
|
<Router>
|
||||||
|
|
Loading…
Reference in a new issue