Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
maksim.zhemerenko committed Mar 6, 2024
1 parent 18a61f8 commit 8483ba0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spryrocks/capacitor-ionic-core-plugin",
"version": "5.8.1-alpha.1",
"version": "5.8.2-alpha.0",
"description": "Ionic plugin core capacitor",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
Expand Down
9 changes: 5 additions & 4 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
LogParams,
MultipleNotifiers,
} from '@spryrocks/logger-plugin';
import {Capacitor} from '@capacitor/core';
import {Mappers} from './mappers';
import {PluginError} from './error';

Expand Down Expand Up @@ -152,7 +153,7 @@ export abstract class CapacitorPlugin<

protected isEventsEnabled() {
// if (!this.isPluginAvailableInCapacitor()) return false;
// if (this.isWeb()) return false;
if (this.isWeb()) return false;

return true; // remove this method after implementation on web
}
Expand Down Expand Up @@ -192,9 +193,9 @@ export abstract class CapacitorPlugin<
// return Capacitor.isPluginAvailable(this.options.pluginName);
// }

// private isWeb() {
// return Capacitor.getPlatform() !== 'web';
// }
private isWeb() {
return Capacitor.getPlatform() === 'web';
}

private logPluginError(method: string | number | symbol, error: PluginError) {
const logger = this.createLogger(undefined, method.toString());
Expand Down

0 comments on commit 8483ba0

Please sign in to comment.