Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TypeError in NotificationsList Component #8007

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@

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 @@
}
} catch (error) {
Sentry.captureException(error);
setIsSubscribed("Error");
}
};

Expand Down
Loading