mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
fix(website): dont crash when serviceWorker is not available (#9331)
This commit is contained in:
@@ -5,7 +5,7 @@ import { useEffect } from 'react';
|
|||||||
export function useUnregisterServiceWorker() {
|
export function useUnregisterServiceWorker() {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// eslint-disable-next-line promise/prefer-await-to-then
|
// eslint-disable-next-line promise/prefer-await-to-then
|
||||||
void navigator.serviceWorker.getRegistrations().then((registrations) => {
|
void navigator.serviceWorker?.getRegistrations().then((registrations) => {
|
||||||
for (const registration of registrations) {
|
for (const registration of registrations) {
|
||||||
void registration.unregister();
|
void registration.unregister();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user