From 3d4e6ed8647d9a153dcd8057b4bc5adb13d9a194 Mon Sep 17 00:00:00 2001 From: Kiran Niranjan Date: Wed, 4 Oct 2023 10:50:14 +0530 Subject: [PATCH] SDA-4332 - Limit toast notification to prevent overlying of call notification --- src/app/auto-update-handler.ts | 7 ++++--- src/renderer/notification-handler.ts | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app/auto-update-handler.ts b/src/app/auto-update-handler.ts index 89ea5496b..795b06507 100644 --- a/src/app/auto-update-handler.ts +++ b/src/app/auto-update-handler.ts @@ -257,9 +257,10 @@ export class AutoUpdate { const cc = config.getFilteredCloudConfigFields([ 'betaAutoUpdateChannelEnabled', ]); - this.channelConfigLocation = cc - ? ChannelConfigLocation.ACP - : ChannelConfigLocation.LOCALFILE; + this.channelConfigLocation = + 'betaAutoUpdateChannelEnabled' in cc && cc.betaAutoUpdateChannelEnabled + ? ChannelConfigLocation.ACP + : ChannelConfigLocation.LOCALFILE; this.finalAutoUpdateChannel = autoUpdateChannel; this.installVariant = installVariant; diff --git a/src/renderer/notification-handler.ts b/src/renderer/notification-handler.ts index 16304c6a6..e07be2afb 100644 --- a/src/renderer/notification-handler.ts +++ b/src/renderer/notification-handler.ts @@ -31,6 +31,7 @@ const NEXT_INSERT_POSITION_WITH_INPUT = 142; const NOTIFICATIONS_PADDING_SEPARATION = 12; const CALL_NOTIFICATION_WIDTH = 264; const CALL_NOTIFICATION_HEIGHT = 286; +const MAX_VISIBLE_TOAST_FOR_CALL_NOTIFICATION = 3; export default class NotificationHandler { public settings: ISettings; public callNotificationSettings: ICorner = { x: 0, y: 0 }; @@ -150,9 +151,9 @@ export default class NotificationHandler { } this.calculateDimensions(); // Maximum amount of Notifications we can show: - this.settings.maxVisibleNotifications = Math.floor( - display.workAreaSize.height / this.settings.totalHeight, - ); + this.settings.maxVisibleNotifications = + Math.floor(display.workAreaSize.height / this.settings.totalHeight) - + MAX_VISIBLE_TOAST_FOR_CALL_NOTIFICATION; } /**