at main 28 lines 917 B view raw
1import { Chrome } from './Chrome'; 2 3export function WithFeatureChecks({ children }) { 4 if (!('serviceWorker' in navigator)) { 5 return ( 6 <p>sorry, your browser does not support the background task needd to deliver notifications</p> 7 ); 8 } 9 10 if (!('PushManager' in window)) { 11 return ( 12 <Chrome> 13 <p>Sorry, your browser does not support Web Push for notifications</p> 14 </Chrome> 15 ); 16 } 17 18 if (!('Notification' in window)) { 19 return ( 20 <Chrome> 21 <p>Sorry, your browser does not support the Notifications API for creating system notifications</p> 22 <p>If you're on iOS, you can try tapping <strong>add to home screen</strong> from the <strong>share</strong> menu, and then opening <strong>Spacedust</strong> from your home screen to unlock notifications support, but note that Web Push in iOS is unreliable.</p> 23 </Chrome> 24 ); 25 } 26 27 return children; 28}