Skip to content

Commit

Permalink
fix(core): Use web listener if there is no native implementation (#4488)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Apr 26, 2021
1 parent 0105f7a commit 196d843
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export const createCapacitor = (win: WindowCapacitor): CapacitorInstance => {
case '$$typeof':
return undefined;
case 'addListener':
return isNativePlatform() ? addListenerNative : addListener;
return pluginHeader ? addListenerNative : addListener;
case 'removeListener':
return removeListener;
default:
Expand Down
4 changes: 2 additions & 2 deletions core/src/tests/legacy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ describe('legacy', () => {

it('doc.addEventListener backbutton', done => {
const AppWeb = class {
async addListener(event: any) {
expect(event.eventName).toBe('backButton');
async addListener(eventName: string) {
expect(eventName).toBe('backButton');
done();
}
};
Expand Down

0 comments on commit 196d843

Please sign in to comment.