1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-06 10:33:57 +00:00

do not show irrelevant success information in the notification confirmation in an error case (#14825)

This commit is contained in:
Jonathan Prusik
2025-05-16 14:34:08 -04:00
committed by GitHub
parent c343f5282e
commit b4b452f5d1
3 changed files with 6 additions and 9 deletions

View File

@@ -37,7 +37,7 @@ export function NotificationConfirmationBody({
theme,
handleOpenVault,
}: NotificationConfirmationBodyProps) {
const IconComponent = tasksAreComplete ? Keyhole : !error ? Celebrate : Warning;
const IconComponent = error ? Warning : tasksAreComplete ? Celebrate : Keyhole;
const showConfirmationMessage = confirmationMessage || buttonText || messageDetails;
@@ -48,8 +48,7 @@ export function NotificationConfirmationBody({
? NotificationConfirmationMessage({
buttonAria,
buttonText,
error,
itemName,
itemName: error ? undefined : itemName,
message: confirmationMessage,
messageDetails,
theme,

View File

@@ -51,9 +51,9 @@ export function NotificationConfirmationContainer({
let messageDetails: string | undefined;
let remainingTasksCount: number | undefined;
let tasksAreComplete: boolean = false;
let tasksAreComplete: boolean = true;
if (task) {
if (task && !error) {
remainingTasksCount = task.remainingTasksCount || 0;
tasksAreComplete = remainingTasksCount === 0;
@@ -85,7 +85,7 @@ export function NotificationConfirmationContainer({
theme,
handleOpenVault,
})}
${remainingTasksCount
${!error && remainingTasksCount
? NotificationConfirmationFooter({
i18n,
theme,

View File

@@ -8,7 +8,6 @@ import { spacing, themes, typography } from "../../constants/styles";
export type NotificationConfirmationMessageProps = {
buttonAria?: string;
buttonText?: string;
error?: string;
itemName?: string;
message?: string;
messageDetails?: string;
@@ -19,7 +18,6 @@ export type NotificationConfirmationMessageProps = {
export function NotificationConfirmationMessage({
buttonAria,
buttonText,
error,
itemName,
message,
messageDetails,
@@ -31,7 +29,7 @@ export function NotificationConfirmationMessage({
${message || buttonText
? html`
<div class=${singleLineWrapperStyles}>
${!error && itemName
${itemName
? html`
<span class=${itemNameStyles(theme)} title=${itemName}> ${itemName} </span>
`