SDA-4332 - Limit toast notification to prevent overlying of call notification (#1966)

This commit is contained in:
Kiran Niranjan 2023-10-04 13:17:18 +05:30 committed by GitHub
parent 61752932b2
commit 641876598a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -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;

View File

@ -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;
}
/**