add logrocket
This commit is contained in:
1 parent
015a2fd66c
commit
7946259550
4 files changed
+28
-5
No files matched your search
Generated
+11
@@ -11,6 +11,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@reduxjs/toolkit": "^1.8.5",
|
"@reduxjs/toolkit": "^1.8.5",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
|
"logrocket": "^3.0.1",
|
||||||
"preact": "^10.10.0",
|
"preact": "^10.10.0",
|
||||||
"preact-render-to-string": "^5.2.1",
|
"preact-render-to-string": "^5.2.1",
|
||||||
"preact-router": "^3.2.1",
|
"preact-router": "^3.2.1",
|
||||||
@@ -11958,6 +11959,11 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"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": {
|
"node_modules/loose-envify": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
|
||||||
@@ -30434,6 +30440,11 @@
|
|||||||
"is-unicode-supported": "^0.1.0"
|
"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": {
|
"loose-envify": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@reduxjs/toolkit": "^1.8.5",
|
"@reduxjs/toolkit": "^1.8.5",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
|
"logrocket": "^3.0.1",
|
||||||
"preact": "^10.10.0",
|
"preact": "^10.10.0",
|
||||||
"preact-render-to-string": "^5.2.1",
|
"preact-render-to-string": "^5.2.1",
|
||||||
"preact-router": "^3.2.1",
|
"preact-router": "^3.2.1",
|
||||||
|
|||||||
+7
-5
@@ -1,10 +1,11 @@
|
|||||||
import { h } from 'preact';
|
import { h } from 'preact';
|
||||||
import { useState, useEffect } from 'preact/hooks';
|
import { useEffect } from 'preact/hooks';
|
||||||
import { useSelector, useDispatch } from 'react-redux'
|
import { useDispatch, Provider } from 'react-redux'
|
||||||
import { Route, Router, route } from 'preact-router';
|
import { Route, Router, } from 'preact-router';
|
||||||
import { Provider } from 'react-redux'
|
import LogRocket from 'logrocket';
|
||||||
|
|
||||||
import createWs from './ws';
|
import createWs from './ws';
|
||||||
|
import store, { wsState } from './store'
|
||||||
|
|
||||||
import Nav from './components/nav';
|
import Nav from './components/nav';
|
||||||
|
|
||||||
@@ -15,7 +16,8 @@ import Search from './routes/search';
|
|||||||
import List from './routes/list';
|
import List from './routes/list';
|
||||||
import Info from './routes/info';
|
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 Main = () => {
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { h } from 'preact';
|
|||||||
import { route } from 'preact-router';
|
import { route } from 'preact-router';
|
||||||
import { useEffect } from 'preact/hooks';
|
import { useEffect } from 'preact/hooks';
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
|
import LogRocket from 'logrocket';
|
||||||
|
|
||||||
import http from './../http';
|
import http from './../http';
|
||||||
import { State } from './../store';
|
import { State } from './../store';
|
||||||
@@ -21,6 +22,14 @@ const Nav = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
route(DEFAULT_ROUTE)
|
route(DEFAULT_ROUTE)
|
||||||
|
|
||||||
|
if (window.location.host === 'matescrates.au') {
|
||||||
|
LogRocket.identify(user.id, {
|
||||||
|
name: user.email,
|
||||||
|
email: user.email,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}, [user])
|
}, [user])
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user