From b2dd6a78a18f8c166a2c5c04cfc85a8ea737c430 Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Mon, 4 Sep 2023 13:14:22 -0500 Subject: [PATCH] style(lint): `yarn lint:js --fix` --- packages/app-check/lib/index.d.ts | 2 +- packages/app-check/lib/index.js | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/app-check/lib/index.d.ts b/packages/app-check/lib/index.d.ts index 75b2882842..329da83b1a 100644 --- a/packages/app-check/lib/index.d.ts +++ b/packages/app-check/lib/index.d.ts @@ -180,7 +180,7 @@ export namespace FirebaseAppCheckTypes { /** * The result return from `onTokenChanged` */ - export type AppCheckListenerResult = AppCheckToken & { readonly appName: String } + export type AppCheckListenerResult = AppCheckToken & { readonly appName: string }; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Statics { diff --git a/packages/app-check/lib/index.js b/packages/app-check/lib/index.js index 0bf828a303..b68734ad6a 100644 --- a/packages/app-check/lib/index.js +++ b/packages/app-check/lib/index.js @@ -151,9 +151,8 @@ class FirebaseAppCheckModule extends FirebaseModule { onTokenChanged(onNextOrObserver, onError, onCompletion) { // iOS does not provide any native listening feature if (isIOS) { - console.warn( - 'onTokenChanged is not implemented on IOS, only for Android', - ); + // eslint-disable-next-line no-console + console.warn('onTokenChanged is not implemented on IOS, only for Android'); return () => {}; } const nextFn = this._parseListener(onNextOrObserver); @@ -168,15 +167,13 @@ class FirebaseAppCheckModule extends FirebaseModule { this.eventNameForApp('onAppCheckTokenChanged'), nextFn, ); - if(this._listenerCount === 0) - this.native.addAppCheckListener(); - + if (this._listenerCount === 0) this.native.addAppCheckListener(); + this._listenerCount++; return () => { - subscription.remove() + subscription.remove(); this._listenerCount--; - if (this._listenerCount === 0) - this.native.removeAppCheckListener(); + if (this._listenerCount === 0) this.native.removeAppCheckListener(); }; } }