mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 03:44:45 +12:00
fix(website): dont crash when serviceWorker is not available (#9331)
This commit is contained in:
parent
6912faa9b3
commit
24f280290b
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue