Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
});
// Set window title.
document.title = `${sceneDesc.name} - ${sceneGroup.name} - noclip`;
const sceneDescId = this._getCurrentSceneDescId()!;
if (typeof gtag !== 'undefined') {
gtag("event", "loadScene", {
'event_category': "Scenes",
'event_label': sceneDescId,
});
}
Sentry.addBreadcrumb({
category: 'loadScene',
message: sceneDescId,
});
Sentry.configureScope((scope) => {
scope.setExtra('sceneDescId', sceneDescId);
});
}
logout() {
if (this.user) {
Sentry.addBreadcrumb({
message: 'Logout',
category: 'auth',
type: 'default',
level: Sentry.Severity.Info,
});
console.log('[AppManager] Logout');
this.simulationManager.clear();
this._user = null;
this._setCurrentUsername(null);
this._userSubject.next(null);
}
}
handleError(error, args) {
const [stateKey] = args;
if (error && error.responseText) {
Sentry.addBreadcrumb({
message: error.responseText,
category: 'xhr',
level: Sentry.Severity.Error,
});
}
this.setState(prevState => {
const loading = prevState.remainingRequests! > 1;
const state: AsyncComponentState = {
[stateKey]: null,
errors: {
...prevState.errors,
[stateKey]: error,
},
error: prevState.error || !!error,
remainingRequests: prevState.remainingRequests! - 1,
loading,
function captureBreadcrumb(message, data={}) {
data.url = window.location.toString();
Sentry.addBreadcrumb({
message, data
});
}
export function sentryBreadCrumb(msg: string) {
Sentry.addBreadcrumb({ message: msg });
}
export default function captureBreadcrumb(crumb: Breadcrumb) {
if (Metrics.isSentryEnabled()) {
addBreadcrumb(crumb);
}
}