chore: floating button for incoming call

This commit is contained in:
Sojan
2025-04-29 03:45:08 -07:00
parent 4c579bc71e
commit 3f0c01e166
11 changed files with 896 additions and 314 deletions
@@ -212,6 +212,33 @@ export class DashboardAudioNotificationHelper {
showBadgeOnFavicon();
this.playAudioEvery30Seconds();
};
onIncomingCall = () => {
// Always play audio alerts for incoming calls, regardless of other settings
// This ensures users never miss a call notification
// Use a different tone for calls if available, otherwise use regular tone
const originalTone = this.audioConfig.tone;
try {
// Temporarily set a call-specific tone if it exists
this.audioConfig.tone = 'call-ring';
this.intializeAudio();
this.playAudioAlert();
} catch (error) {
console.error('Error playing call notification:', error);
// Fallback to regular tone
this.audioConfig.tone = originalTone;
this.intializeAudio();
this.playAudioAlert();
} finally {
// Restore original tone for messages
this.audioConfig.tone = originalTone;
this.intializeAudio();
}
// Also show badge on favicon
showBadgeOnFavicon();
};
}
export default new DashboardAudioNotificationHelper(GlobalStore);