Skip to content

Commit b133df8

Browse files
committed
Expose env-dependent constant to service worker; Add Brave Browser-specific push registration error and guidance; Remove unused fetch debug plugin
1 parent 75d0a8e commit b133df8

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

components/notifications.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,10 @@ export function NotificationAlert () {
714714
const [supported, setSupported] = useState(false)
715715
const sw = useServiceWorker()
716716

717+
useEffect(() => {
718+
console.log(error)
719+
}, [error])
720+
717721
useEffect(() => {
718722
const isSupported = sw.support.serviceWorker && sw.support.pushManager && sw.support.notification
719723
if (isSupported) {
@@ -733,7 +737,10 @@ export function NotificationAlert () {
733737
error
734738
? (
735739
<Alert variant='danger' dismissible onClose={() => setError(null)}>
736-
<span>{error.toString()}</span>
740+
<span>{navigator?.brave && error.name === 'AbortError'
741+
? 'Push registration failed. Enable "Use Google services for push messaging" in Brave\'s privacy settings and try again.'
742+
: error.toString()}
743+
</span>
737744
</Alert>
738745
)
739746
: showAlert

next.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ module.exports = withPlausibleProxy()({
220220
'process.env.NEXT_PUBLIC_NORMAL_POLL_INTERVAL': JSON.stringify(process.env.NEXT_PUBLIC_NORMAL_POLL_INTERVAL),
221221
'process.env.NEXT_PUBLIC_LONG_POLL_INTERVAL': JSON.stringify(process.env.NEXT_PUBLIC_LONG_POLL_INTERVAL),
222222
'process.env.NEXT_PUBLIC_EXTRA_LONG_POLL_INTERVAL': JSON.stringify(process.env.NEXT_PUBLIC_EXTRA_LONG_POLL_INTERVAL),
223+
'process.env.SANCTIONED_COUNTRY_CODES': JSON.stringify(process.env.SANCTIONED_COUNTRY_CODES),
223224
'process.env.NEXT_IS_EXPORT_WORKER': 'true'
224225
})
225226
]

sw/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ self.addEventListener('install', () => self.skipWaiting())
3131
// Also, the offline fallback only works if request matched a route
3232
setDefaultHandler(new NetworkOnly({
3333
plugins: [{
34-
fetchDidFail: async (args) => {
35-
// tell us why a request failed in dev
36-
process.env.NODE_ENV !== 'production' && console.log('fetch did fail', ...args)
37-
},
3834
fetchDidSucceed: async ({ request, response, event, state }) => {
3935
if (
4036
response.ok &&

0 commit comments

Comments
 (0)