Skip to content

Commit 8fda7f5

Browse files
chore: fix eslint warnings
1 parent 1e570fd commit 8fda7f5

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Messenger } from '@metamask/base-controller';
22
import type { AuthenticationController } from '@metamask/profile-sync-controller';
3-
import log from 'loglevel';
43

54
import NotificationServicesPushController from './NotificationServicesPushController';
65
import type {
@@ -11,10 +10,6 @@ import type {
1110
import * as services from './services/services';
1211
import type { PushNotificationEnv } from './types';
1312

14-
// Testing util to clean up verbose logs when testing errors
15-
const mockErrorLog = () =>
16-
jest.spyOn(log, 'error').mockImplementation(jest.fn());
17-
1813
const MOCK_JWT = 'mockJwt';
1914
const MOCK_FCM_TOKEN = 'mockFcmToken';
2015
const MOCK_MOBILE_FCM_TOKEN = 'mockMobileFcmToken';
@@ -89,7 +84,7 @@ describe('NotificationServicesPushController', () => {
8984
arrangeServicesMocks();
9085
const { controller, messenger } = arrangeMockMessenger();
9186
mockAuthBearerTokenCall(messenger);
92-
await controller.disablePushNotifications(MOCK_TRIGGERS);
87+
await controller.disablePushNotifications();
9388
expect(controller.state.fcmToken).toBe('');
9489
});
9590
});

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,9 @@ export default class NotificationServicesPushController extends BaseController<
286286

287287
/**
288288
* Disables push notifications for the application.
289-
* This method handles the process of disabling push notifications by:
290-
* 1. Unregistering the service worker to stop listening for messages.
291-
* 2. Sending a request to the server to unregister the device using the FCM token.
292-
* 3. Removing the FCM token from the state to complete the process.
293-
*
294-
* @param UUIDs - An array of UUIDs for which push notifications should be disabled.
289+
* This removes the registration token on this device, and ensures we unsubscribe from any listeners
295290
*/
296-
async disablePushNotifications(UUIDs: string[]) {
291+
async disablePushNotifications() {
297292
if (!this.#config.isPushEnabled) {
298293
return;
299294
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import log from 'loglevel';
2-
31
import * as endpoints from './endpoints';
42
import type { CreateRegToken, DeleteRegToken } from './push';
53
import {

0 commit comments

Comments
 (0)