Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
fix: chashes when disabling bug snag
Browse files Browse the repository at this point in the history
  • Loading branch information
radko93 committed Dec 22, 2020
1 parent 3d54a1b commit 69052a5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
Expand Up @@ -81,7 +81,7 @@ public void onCreate() {
SharedPreferences settings = getApplicationContext().getSharedPreferences("react-native", Context.MODE_PRIVATE);
String bugsnagOptOut = settings.getString("bugsnagoptout", "false");

if (bugsnagOptOut.equals("true")) {
if (!bugsnagOptOut.equals("true")) {
Bugsnag.start(this, config);
}

Expand Down
2 changes: 1 addition & 1 deletion ios/StandardNotes/AppDelegate.m
Expand Up @@ -40,7 +40,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
config.enabledBreadcrumbTypes = BSGEnabledBreadcrumbTypeNavigation | BSGEnabledBreadcrumbTypeLog
| BSGEnabledBreadcrumbTypeUser | BSGEnabledBreadcrumbTypeState | BSGEnabledBreadcrumbTypeNavigation | BSGEnabledBreadcrumbTypeProcess;

if ([bugsnagOptOut isEqualToString:@"true"]) {
if (![bugsnagOptOut isEqualToString:@"true"]) {
[Bugsnag startWithConfiguration:config];
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "StandardNotes",
"version": "3.5.13",
"user-version": "3.5.13",
"version": "3.5.14",
"user-version": "3.5.14",
"private": true,
"license": "AGPL-3.0-or-later",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion src/App.tsx
Expand Up @@ -134,7 +134,11 @@ export const App = (props: { env: 'prod' | 'dev'; bugsnagOptOut: boolean }) => {

useEffect(() => {
if (!__DEV__ && !props.bugsnagOptOut) {
Bugsnag.start();
try {
Bugsnag.start();
} catch {
console.error('Bugnsag failed to start');
}
}
}, [props.bugsnagOptOut]);

Expand Down
2 changes: 1 addition & 1 deletion src/screens/Settings/Sections/CompanySection.tsx
Expand Up @@ -54,7 +54,7 @@ export const CompanySection = (props: Props) => {
'Changes will be refrected after an app restart.'
);
} catch {
application?.alertService.alert('Changing ');
application?.alertService.alert('An error occured. Please try again.');
}
},
[application?.alertService, application?.deviceInterface]
Expand Down

0 comments on commit 69052a5

Please sign in to comment.