Skip to content

Commit

Permalink
Add comment explaining Protect status exception, per feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottprogrammer committed Dec 20, 2024
1 parent feff403 commit fd97fdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ const getStatusClassName: StatusStateFunction = ( slug, status, isOwned ) => {
return isOwned ? styles.warning : styles.inactive;
case PRODUCT_STATUSES.EXPIRED:
case PRODUCT_STATUSES.NEEDS_ATTENTION__WARNING:
/**
* For the Protect card, even when it has a NEEDS_ATTENTION__{WARNING | ERROR}
* status (it means threats have been detected), we still want to show the card
* status as 'Active'.
*/
if ( slug === 'protect' ) {
return styles.active;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ public static function does_module_need_attention() {
if ( is_wp_error( $protect_data ) ) {
return $protect_threat_status; // false
}
$critical_threat_count = false;
if ( ! empty( $protect_data->threats ) ) {
$critical_threat_count = array_reduce(
$protect_data->threats,
Expand Down

0 comments on commit fd97fdc

Please sign in to comment.