Skip to content

Commit 29ca3da

Browse files
refactor: fix lint
1 parent 5f45f70 commit 29ca3da

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

packages/notification-services-controller/src/NotificationServicesController/NotificationServicesController.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import * as OnChainNotifications from './services/onchain-notifications';
4747
import type { INotification } from './types';
4848
import type { UserStorage } from './types/user-storage/user-storage';
4949
import * as Utils from './utils/utils';
50-
import { NotificationServicesPushControllerGetStateAction } from '../NotificationServicesPushController';
50+
import type { NotificationServicesPushControllerGetStateAction } from '../NotificationServicesPushController';
5151

5252
// Mock type used for testing purposes
5353
// eslint-disable-next-line @typescript-eslint/no-explicit-any

packages/notification-services-controller/src/NotificationServicesController/NotificationServicesController.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ export default class NotificationServicesController extends BaseController<
307307
#isPushNotificationsSetup = false;
308308

309309
#isUnlocked = false;
310+
310311
#keyringController = {
311312
setupLockedStateSubscriptions: (onUnlock: () => Promise<void>) => {
312313
const { isUnlocked } = this.messagingSystem.call(
@@ -382,7 +383,6 @@ export default class NotificationServicesController extends BaseController<
382383
// Push notifications were disabled
383384
if (prevVal === true && newVal === false) {
384385
this.#isPushNotificationsSetup = false;
385-
return;
386386
}
387387
} catch {
388388
// Do nothing, silently fail push notifications
@@ -565,7 +565,6 @@ export default class NotificationServicesController extends BaseController<
565565
* @param args.state - Initial state to set on this controller.
566566
* @param args.env - environment variables for a given controller.
567567
* @param args.env.featureAnnouncements - env variables for feature announcements.
568-
* @param args.env.isPushIntegrated - toggle push notifications on/off if client has integrated them.
569568
*/
570569
constructor({
571570
messenger,

packages/notification-services-controller/src/NotificationServicesPushController/NotificationServicesPushController.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import { BaseController } from '@metamask/base-controller';
88
import type { AuthenticationController } from '@metamask/profile-sync-controller';
99
import log from 'loglevel';
1010

11-
import type { Types } from '../NotificationServicesController';
1211
import {
1312
activatePushNotifications,
1413
deactivatePushNotifications,
1514
updateTriggerPushNotifications,
1615
} from './services/services';
1716
import type { PushNotificationEnv } from './types';
1817
import type { PushService } from './types/push-service-interface';
18+
import type { Types } from '../NotificationServicesController';
1919

2020
const controllerName = 'NotificationServicesPushController';
2121

@@ -143,8 +143,6 @@ export type ControllerConfig = {
143143
* It is responsible for registering and unregistering the service worker that listens for push notifications,
144144
* managing the FCM token, and communicating with the server to register or unregister the device for push notifications.
145145
* Additionally, it provides functionality to update the server with new UUIDs that should trigger push notifications.
146-
*
147-
* @augments {BaseController<typeof controllerName, NotificationServicesPushControllerState, NotificationServicesPushControllerMessenger>}
148146
*/
149147
export default class NotificationServicesPushController extends BaseController<
150148
typeof controllerName,
@@ -153,9 +151,9 @@ export default class NotificationServicesPushController extends BaseController<
153151
> {
154152
#pushListenerUnsubscribe: (() => void) | undefined = undefined;
155153

156-
#env: PushNotificationEnv;
154+
readonly #env: PushNotificationEnv;
157155

158-
#config: ControllerConfig;
156+
readonly #config: ControllerConfig;
159157

160158
constructor({
161159
messenger,
@@ -232,7 +230,7 @@ export default class NotificationServicesPushController extends BaseController<
232230
(await this.#config.pushService.subscribeToPushNotifications(
233231
this.#env,
234232
)) ?? undefined;
235-
} catch (e) {
233+
} catch {
236234
// Do nothing, we are silently failing if push notification registration fails
237235
}
238236
}
@@ -301,11 +299,9 @@ export default class NotificationServicesPushController extends BaseController<
301299
}
302300

303301
const bearerToken = await this.#getAndAssertBearerToken();
304-
let isPushNotificationsDisabled: boolean;
305-
306302
try {
307303
// Send a request to the server to unregister the token/device
308-
isPushNotificationsDisabled = await deactivatePushNotifications({
304+
await deactivatePushNotifications({
309305
bearerToken,
310306
triggers: UUIDs,
311307
env: this.#env,

0 commit comments

Comments
 (0)