fix(notifications): do not support browser notifications for local servers

This commit is contained in:
Gabe Kangas
2023-04-15 20:10:34 -07:00
parent 74bdab81a3
commit dde512fa14
2 changed files with 11 additions and 5 deletions

View File

@ -17,6 +17,10 @@ const NotificationsNotSupported = () => (
<div>Browser notifications are not supported in your browser.</div>
);
const NotificationsNotSupportedLocal = () => (
<div>Browser notifications are not supported for local servers.</div>
);
export type PermissionPopupPreviewProps = {
start: () => void;
};
@ -106,6 +110,10 @@ export const BrowserNotifyModal = () => {
setBrowserPushPermissionsPending(false);
};
if (window.location.hostname === 'localhost') {
return <NotificationsNotSupportedLocal />;
}
if (!browserPushSupported) {
return <NotificationsNotSupported />;
}