change(ui): clear exc log on each session

This commit is contained in:
nick-delirium 2023-01-16 12:23:23 +01:00
parent c812f2faed
commit 7df87f1c9b
3 changed files with 55 additions and 47 deletions

View file

@ -7,61 +7,63 @@ import { fetchList as fetchSlackList } from 'Duck/integrations/slack';
import { Loader } from 'UI';
import withPermissions from 'HOCs/withPermissions';
import LivePlayer from './LivePlayer';
import { clearLogs } from 'App/dev/console';
function LiveSession({
sessionId,
loading,
fetchSession,
fetchSlackList,
hasSessionsPath,
sessionId,
loading,
fetchSession,
fetchSlackList,
hasSessionsPath,
}) {
usePageTitle('OpenReplay Assist');
usePageTitle('OpenReplay Assist');
useEffect(() => {
fetchSlackList();
}, []);
useEffect(() => {
clearLogs();
fetchSlackList();
}, []);
useEffect(() => {
if (sessionId != null) {
fetchSession(sessionId, true);
} else {
console.error('No sessionID in route.');
}
}, [sessionId, hasSessionsPath]);
useEffect(() => {
if (sessionId != null) {
fetchSession(sessionId, true);
} else {
console.error('No sessionID in route.');
}
}, [sessionId, hasSessionsPath]);
return (
<Loader className="flex-1" loading={loading}>
<LivePlayer />
</Loader>
);
return (
<Loader className="flex-1" loading={loading}>
<LivePlayer />
</Loader>
);
}
export default withPermissions(
['ASSIST_LIVE'],
'',
true
['ASSIST_LIVE'],
'',
true
)(
connect(
(state, props) => {
const {
match: {
params: { sessionId },
connect(
(state, props) => {
const {
match: {
params: { sessionId },
},
} = props;
const isAssist = state.getIn(['sessions', 'activeTab']).type === 'live';
const hasSessiosPath = state
.getIn(['sessions', 'sessionPath'])
.pathname.includes('/sessions');
return {
sessionId,
loading: state.getIn(['sessions', 'loading']),
session: state.getIn(['sessions', 'current']),
hasSessionsPath: hasSessiosPath && !isAssist,
};
},
} = props;
const isAssist = state.getIn(['sessions', 'activeTab']).type === 'live';
const hasSessiosPath = state
.getIn(['sessions', 'sessionPath'])
.pathname.includes('/sessions');
return {
sessionId,
loading: state.getIn(['sessions', 'loading']),
session: state.getIn(['sessions', 'current']),
hasSessionsPath: hasSessiosPath && !isAssist,
};
},
{
fetchSession,
fetchSlackList,
}
)(LiveSession)
{
fetchSession,
fetchSlackList,
}
)(LiveSession)
);

View file

@ -9,6 +9,7 @@ import { sessions as sessionsRoute } from 'App/routes';
import withPermissions from 'HOCs/withPermissions'
import WebPlayer from './WebPlayer';
import { useStore } from 'App/mstore';
import { clearLogs } from 'App/dev/console';
const SESSIONS_ROUTE = sessionsRoute();
@ -31,6 +32,7 @@ function Session({
},[ sessionId ]);
useEffect(() => {
clearLogs()
sessionStore.resetUserFilter();
} ,[])

View file

@ -7,7 +7,11 @@ export const options = {
},
enableCrash: false,
verbose: false,
exceptionsLogs: []
exceptionsLogs: [],
}
export const clearLogs = () => {
options.exceptionsLogs = []
}
const storedString = localStorage.getItem(KEY)