Skip to content

Commit

Permalink
Merge pull request #53 from capacitor-community/crashes-typo
Browse files Browse the repository at this point in the history
typo in setEnabled function
  • Loading branch information
johnborges authored Dec 20, 2021
2 parents 8679e3e + a3df1dc commit 8ec37aa
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
7 changes: 7 additions & 0 deletions appcenter-crashes/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## [1.0.1](https://github.com/capacitor-community/appcenter-sdk-capacitor/compare/@capacitor-community/[email protected]...@capacitor-community/[email protected])

### Fixes

* **android**: change `setEnable` to `setEnabled`
* **ios**: use correct `enable` flag for `setEnabled`

## [1.0.0](https://github.com/capacitor-community/appcenter-sdk-capacitor/compare/@capacitor-community/[email protected]...@capacitor-community/[email protected])

### Chore
Expand Down
2 changes: 1 addition & 1 deletion appcenter-crashes/ios/Plugin/AppCenterCrashesPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class CrashesPlugin: CAPPlugin {
}

@objc func setEnabled(_ call: CAPPluginCall) {
implementation.enable(call.getBool("shouldEnable") ?? false)
implementation.enable(call.getBool("enable") ?? false)
call.resolve()
}

Expand Down
2 changes: 1 addition & 1 deletion appcenter-crashes/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capacitor-community/appcenter-crashes",
"version": "1.0.0",
"version": "1.0.1",
"description": "Capacitor plugin for Microsoft's App Center Crashes",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
Expand Down
4 changes: 2 additions & 2 deletions appcenter-crashes/src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ export interface CrashesPlugin {
* You can enable and disable App Center Crashes at runtime. If you disable it, the SDK won't do any crash reporting for the app.
* The state is persisted in the device's storage across application launches.
* @param {enable: boolean} options
* @since 0.1.0
* @since 0.1.1
* @example
* import Crashes from '@capacitor-community/appcenter-crashes';
*
* await Crashes.enable({enable: true});
* await Crashes.setEnabled({enable: true});
*/
setEnabled(options: { enable: boolean }): Promise<void>;

Expand Down
12 changes: 6 additions & 6 deletions example/src/components/app-crashes/app-crashes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ export class AppCrashes {
}

async componentWillLoad() {
try {
const { value: crashesEnabled } = await Crashes.isEnabled();
const { value: memoryWarning } = await Crashes.hasReceivedMemoryWarningInLastSession();
const { value: hasCrashed } = await Crashes.hasCrashedInLastSession();
const { value: crashReport } = await Crashes.lastSessionCrashReport();
try {
const { value: crashReport } = await Crashes.lastSessionCrashReport();
this.crashReport = crashReport;
} catch (error) {
console.error(error);
}

this.enabled = crashesEnabled
this.memoryWarning = memoryWarning
this.hasCrashed = hasCrashed
this.crashReport = crashReport;
} catch (error) {
console.error(error)
}
}

async toggleCrashes(e: CustomEvent<ToggleChangeEventDetail>) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"scripts": {
"fmt": "lerna run fmt --ignore example",
"lint": "lerna run lint --ignore example",
"build": "lerna run build --ignore example",
"verify": "lerna run verify --ignore example",
"verify:ios": "lerna run verify:ios --ignore example",
"verify:android": "lerna run verify:android --ignore example",
Expand Down

0 comments on commit 8ec37aa

Please sign in to comment.