add logrocket

This commit is contained in:
ntr committed 2022-10-04 22:59:02 +11:00
1 parent 015a2fd66c
commit 7946259550
4 files changed
+28 -5

No files matched your search

+11
View File
@@ -11,6 +11,7 @@
"dependencies": {
"@reduxjs/toolkit": "^1.8.5",
"lodash": "^4.17.21",
"logrocket": "^3.0.1",
"preact": "^10.10.0",
"preact-render-to-string": "^5.2.1",
"preact-router": "^3.2.1",
@@ -11958,6 +11959,11 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/logrocket": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/logrocket/-/logrocket-3.0.1.tgz",
"integrity": "sha512-jOWG+jEzobKVxGytzZ+4KGm2kiMQMRTHab2uDWQyVZcHfEF38BlCH1yjQVY4LCmuQUwZitP9biMzJZnyUQ0dtQ=="
},
"node_modules/loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
@@ -30434,6 +30440,11 @@
"is-unicode-supported": "^0.1.0"
}
},
"logrocket": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/logrocket/-/logrocket-3.0.1.tgz",
"integrity": "sha512-jOWG+jEzobKVxGytzZ+4KGm2kiMQMRTHab2uDWQyVZcHfEF38BlCH1yjQVY4LCmuQUwZitP9biMzJZnyUQ0dtQ=="
},
"loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
+1
View File
@@ -11,6 +11,7 @@
"dependencies": {
"@reduxjs/toolkit": "^1.8.5",
"lodash": "^4.17.21",
"logrocket": "^3.0.1",
"preact": "^10.10.0",
"preact-render-to-string": "^5.2.1",
"preact-router": "^3.2.1",
+7 -5
View File
@@ -1,10 +1,11 @@
import { h } from 'preact';
import { useState, useEffect } from 'preact/hooks';
import { useSelector, useDispatch } from 'react-redux'
import { Route, Router, route } from 'preact-router';
import { Provider } from 'react-redux'
import { useEffect } from 'preact/hooks';
import { useDispatch, Provider } from 'react-redux'
import { Route, Router, } from 'preact-router';
import LogRocket from 'logrocket';
import createWs from './ws';
import store, { wsState } from './store'
import Nav from './components/nav';
@@ -15,7 +16,8 @@ import Search from './routes/search';
import List from './routes/list';
import Info from './routes/info';
import store, { userState, wsState, State } from './store'
if (window.location.host === 'matescrates.au') LogRocket.init('yh0dy3/mcrates');
const Main = () => {
const dispatch = useDispatch()
+9
View File
@@ -2,6 +2,7 @@ import { h } from 'preact';
import { route } from 'preact-router';
import { useEffect } from 'preact/hooks';
import { useSelector } from 'react-redux'
import LogRocket from 'logrocket';
import http from './../http';
import { State } from './../store';
@@ -21,6 +22,14 @@ const Nav = () => {
return;
}
route(DEFAULT_ROUTE)
if (window.location.host === 'matescrates.au') {
LogRocket.identify(user.id, {
name: user.email,
email: user.email,
});
}
return;
}, [user])