mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-03 04:27:53 +00:00
Merge remote-tracking branch 'origin/develop' into feat/voice-channel
This commit is contained in:
@@ -68,13 +68,17 @@ export const registerSubscription = (onSuccess = () => {}) => {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
onSuccess();
|
onSuccess();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(error => {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error('Push subscription registration failed:', error);
|
||||||
useAlert('This browser does not support desktop notification');
|
useAlert('This browser does not support desktop notification');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const requestPushPermissions = ({ onSuccess }) => {
|
export const requestPushPermissions = ({ onSuccess }) => {
|
||||||
if (!('Notification' in window)) {
|
if (!('Notification' in window)) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.warn('Notification is not supported');
|
||||||
useAlert('This browser does not support desktop notification');
|
useAlert('This browser does not support desktop notification');
|
||||||
} else if (Notification.permission === 'granted') {
|
} else if (Notification.permission === 'granted') {
|
||||||
registerSubscription(onSuccess);
|
registerSubscription(onSuccess);
|
||||||
|
|||||||
Reference in New Issue
Block a user