mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +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() {
|
||||
useEffect(() => {
|
||||
// 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) {
|
||||
void registration.unregister();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user