Skip to content

Commit

Permalink
SDA-4332 - Limit toast notification to prevent overlying of call noti…
Browse files Browse the repository at this point in the history
…fication
  • Loading branch information
KiranNiranjan authored and Kiran Niranjan committed Oct 4, 2023
1 parent c6182a9 commit 3d4e6ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/app/auto-update-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 4 additions & 3 deletions src/renderer/notification-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 3d4e6ed

Please sign in to comment.