Skip to content

Commit 44d854d

Browse files
committed
More cleanup
1 parent c5d3924 commit 44d854d

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

projects/packages/my-jetpack/_inc/components/product-cards-section/backup-card/index.jsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ const BackupCard = props => {
7777
const { detail } = useProduct( productSlug );
7878
const { status, doesModuleNeedAttention } = detail;
7979
const lastBackupFailed = !! doesModuleNeedAttention;
80-
const lastBackupStatus = doesModuleNeedAttention?.data?.status || undefined;
81-
const statusType = doesModuleNeedAttention?.type || undefined;
80+
const lastBackupStatus = doesModuleNeedAttention?.data?.status || {};
8281
const hasBackups = status === PRODUCT_STATUSES.ACTIVE || status === PRODUCT_STATUSES.CAN_UPGRADE;
8382
const noDescription = () => null;
8483
const { siteUrl = '' } = getMyJetpackWindowInitialState();
@@ -93,12 +92,9 @@ const BackupCard = props => {
9392

9493
// Check if backups are deactivated (INACTIVE status with info type).
9594
const isDeactivated =
96-
status === PRODUCT_STATUSES.INACTIVE &&
97-
statusType === 'info' &&
98-
lastBackupStatus === 'backups-deactivated';
95+
status === PRODUCT_STATUSES.INACTIVE && lastBackupStatus === 'backups-deactivated';
9996

100-
const isError =
101-
status === PRODUCT_STATUSES.NEEDS_ATTENTION__ERROR && lastBackupFailed && ! isDeactivated;
97+
const isError = status === PRODUCT_STATUSES.NEEDS_ATTENTION__ERROR && lastBackupFailed;
10298

10399
// Build support URL with pre-filled subject and site URL
104100
const supportUrl = getRedirectUrl( 'jetpack-backup-support-reactivate', {
@@ -140,7 +136,7 @@ const BackupCard = props => {
140136
</div>
141137
<div className={ styles.contentContainer }>
142138
<Text variant="body-small" className="value-section__heading">
143-
{ errorTitle || __( 'The last backup attempt failed.', 'jetpack-my-jetpack' ) }
139+
{ __( 'The last backup attempt failed.', 'jetpack-my-jetpack' ) }
144140
<InfoTooltip
145141
tracksEventName={ 'backup_card_tooltip_open' }
146142
tracksEventProps={ {

projects/packages/my-jetpack/src/products/class-backup.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,6 @@ public static function does_module_need_attention() {
392392
),
393393
);
394394
}
395-
396-
// Override 'backups-deactivated' type as `info`
397-
if ( 'backups-deactivated' === $last_backup->status && $backup_failed_status ) {
398-
$backup_failed_status['type'] = 'info';
399-
}
400395
}
401396
}
402397

@@ -476,12 +471,7 @@ public static function get_status() {
476471

477472
// Check if backups are deactivated (not an error, just manually turned off).
478473
$needs_attention = static::does_module_need_attention();
479-
if ( is_array( $needs_attention ) &&
480-
isset( $needs_attention['type'] ) &&
481-
'info' === $needs_attention['type'] &&
482-
isset( $needs_attention['data']['status'] ) &&
483-
'backups-deactivated' === $needs_attention['data']['status']
484-
) {
474+
if ( is_array( $needs_attention ) && 'backups-deactivated' === $needs_attention['data']['status'] ) {
485475
// Return INACTIVE status for deactivated backups (neutral, not attention-grabbing).
486476
return \Automattic\Jetpack\My_Jetpack\Products::STATUS_INACTIVE;
487477
}

0 commit comments

Comments
 (0)