Skip to content

Commit

Permalink
Fix TypeError in NotificationsList Component
Browse files Browse the repository at this point in the history
  • Loading branch information
bodhish committed Jun 9, 2024
1 parent fc714f4 commit b0413e3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Components/Notifications/NotificationsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,16 @@ export default function NotificationsList({

const intialSubscriptionState = async () => {
try {
if (!("serviceWorker" in navigator)) {
throw new Error("Service Worker is not supported in this browser.");

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (4)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (4)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (3)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (3)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (2)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (2)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (5)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (5)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (7)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (7)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (6)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (6)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (1)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (1)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (8)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 201 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (8)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.
}
const res = await request(routes.getUserPnconfig, {
pathParams: { username: username },
});
const reg = await navigator.serviceWorker.ready;
if (!reg.pushManager) {
throw new Error("Push Manager is not available in this service worker.");

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `"Push·Manager·is·not·available·in·this·service·worker."` with `⏎··········"Push·Manager·is·not·available·in·this·service·worker.",⏎········`

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (4)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (4)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (3)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (3)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (2)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (2)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (5)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (5)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (7)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (7)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (6)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (6)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (1)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (1)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (8)

'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

Check failure on line 208 in src/Components/Notifications/NotificationsList.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (8)

Argument of type 'string' is not assignable to parameter of type '{ msg: any; }'.
}
const subscription = await reg.pushManager.getSubscription();
if (!subscription && !res.data?.pf_endpoint) {
setIsSubscribed("NotSubscribed");
Expand All @@ -211,6 +217,7 @@ export default function NotificationsList({
}
} catch (error) {
Sentry.captureException(error);
setIsSubscribed("Error");
}
};

Expand Down

0 comments on commit b0413e3

Please sign in to comment.