mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[PM-21441] Defect - Notification bar sometimes gets cut off in fill dev (#14764)
* PM-21441 * revert default value
This commit is contained in:
@@ -17,7 +17,7 @@ export class OverlayNotificationsContentService
|
||||
private notificationBarIframeElement: HTMLIFrameElement | null = null;
|
||||
private currentNotificationBarType: string | null = null;
|
||||
private removeTabFromNotificationQueueTypes = new Set(["add", "change"]);
|
||||
private notificationRefreshFlag: boolean;
|
||||
private notificationRefreshFlag: boolean = false;
|
||||
private notificationBarElementStyles: Partial<CSSStyleDeclaration> = {
|
||||
height: "82px",
|
||||
width: "430px",
|
||||
@@ -57,6 +57,7 @@ export class OverlayNotificationsContentService
|
||||
void sendExtensionMessage("checkNotificationQueue");
|
||||
void sendExtensionMessage("notificationRefreshFlagValue").then((notificationRefreshFlag) => {
|
||||
this.notificationRefreshFlag = !!notificationRefreshFlag;
|
||||
this.setNotificationRefreshBarHeight();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -223,15 +224,31 @@ export class OverlayNotificationsContentService
|
||||
this.notificationBarElement.id = "bit-notification-bar";
|
||||
|
||||
setElementStyles(this.notificationBarElement, this.notificationBarElementStyles, true);
|
||||
|
||||
if (this.notificationRefreshFlag) {
|
||||
setElementStyles(this.notificationBarElement, { height: "400px", right: "0" }, true);
|
||||
}
|
||||
this.setNotificationRefreshBarHeight();
|
||||
|
||||
this.notificationBarElement.appendChild(this.notificationBarIframeElement);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the height of the notification bar based on the value of `notificationRefreshFlag`.
|
||||
* If the flag is `true`, the bar is expanded to 400px and aligned right.
|
||||
* If the flag is `false`, `null`, or `undefined`, it defaults to height of 82px.
|
||||
* Skips if the notification bar element has not yet been created.
|
||||
*
|
||||
*/
|
||||
private setNotificationRefreshBarHeight() {
|
||||
const isNotificationV3 = !!this.notificationRefreshFlag;
|
||||
|
||||
if (!this.notificationBarElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isNotificationV3) {
|
||||
setElementStyles(this.notificationBarElement, { height: "400px", right: "0" }, true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up the message listener for the initialization of the notification bar.
|
||||
* This will send the initialization data to the notification bar iframe.
|
||||
|
||||
Reference in New Issue
Block a user