aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-08-04 22:34:49 -0400
committerLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-08-04 22:34:49 -0400
commitb5f17dc7a6f706a302d01fc129f5bf7edf6d8471 (patch)
tree3906915dbbb072fcf6b47da87d7ecaff5115da1b /src
parent539cf5c24aff952253f8df4602d4f038b66bcb8e (diff)
downloaddonetick-frontend-b5f17dc7a6f706a302d01fc129f5bf7edf6d8471.tar.gz
donetick-frontend-b5f17dc7a6f706a302d01fc129f5bf7edf6d8471.tar.bz2
donetick-frontend-b5f17dc7a6f706a302d01fc129f5bf7edf6d8471.zip
Update dependencies and configuration files to support the use OpenReply to do Session replay
Diffstat (limited to 'src')
-rw-r--r--src/App.jsx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/App.jsx b/src/App.jsx
index e436ecc..de8a3dd 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -1,5 +1,6 @@
import NavBar from '@/views/components/NavBar'
import { Button, Snackbar, Typography, useColorScheme } from '@mui/joy'
+import Tracker from '@openreplay/tracker'
import { useEffect, useState } from 'react'
import { Outlet } from 'react-router-dom'
import { useRegisterSW } from 'virtual:pwa-register/react'
@@ -19,6 +20,8 @@ const remove = className => {
const intervalMS = 5 * 60 * 1000 // 5 minutes
function App() {
+ startOpenReplay()
+
const { mode, systemMode } = useColorScheme()
const [userProfile, setUserProfile] = useState(null)
const [showUpdateSnackbar, setShowUpdateSnackbar] = useState(true)
@@ -115,4 +118,11 @@ function App() {
)
}
+const startOpenReplay = () => {
+ if (!import.meta.env.VITE_OPENREPLAY_PROJECT_KEY) return
+ const tracker = new Tracker({
+ projectKey: import.meta.env.VITE_OPENREPLAY_PROJECT_KEY,
+ })
+ tracker.start()
+}
export default App