feat: add random identifier to bugsnag reports

This commit is contained in:
Baptiste Grob
2021-01-22 15:31:56 +01:00
parent 2c4742a91d
commit 0bd3143481
6 changed files with 49 additions and 8 deletions

View File

@@ -24,6 +24,11 @@ import { BackupFile, ContentType } from '@standardnotes/snjs';
import { confirmDialog, alertDialog } from '@/services/alertService';
import { autorun, IReactionDisposer } from 'mobx';
import { storage, StorageKey } from '@/services/localStorage';
import {
disableErrorReporting,
enableErrorReporting,
errorReportingId
} from '@/services/errorReporting';
const ELEMENT_ID_IMPORT_PASSWORD_INPUT = 'import-password-request';
@@ -66,6 +71,7 @@ type AccountMenuState = {
syncInProgress: boolean;
syncError: string;
showSessions: boolean;
errorReportingId: string | null;
}
class AccountMenuCtrl extends PureViewCtrl<unknown, AccountMenuState> {
@@ -99,6 +105,7 @@ class AccountMenuCtrl extends PureViewCtrl<unknown, AccountMenuState> {
showBetaWarning: false,
errorReportingEnabled: storage.get(StorageKey.DisableErrorReporting) === false,
showSessions: false,
errorReportingId: errorReportingId(),
} as AccountMenuState;
}
@@ -550,9 +557,9 @@ class AccountMenuCtrl extends PureViewCtrl<unknown, AccountMenuState> {
toggleErrorReportingEnabled() {
if (this.state.errorReportingEnabled) {
storage.set(StorageKey.DisableErrorReporting, true);
disableErrorReporting();
} else {
storage.set(StorageKey.DisableErrorReporting, false);
enableErrorReporting();
}
if (!this.state.syncInProgress) {
window.location.reload();