Skip to content

Commit

Permalink
Sitegen: Refactor Error State
Browse files Browse the repository at this point in the history
  • Loading branch information
arunshenoy99 committed Apr 1, 2024
1 parent 08e1970 commit e471bf9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions includes/Services/FlowService.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ public static function get_data() {
$result = self::get_default_data();
self::update_data_in_wp_option( $result );
}

$result = SiteGenService::reset_error_status( $result );

return $result;
}

Expand Down
8 changes: 8 additions & 0 deletions includes/Services/SiteGenService.php
Original file line number Diff line number Diff line change
Expand Up @@ -1157,4 +1157,12 @@ public static function sync_flow_data( $updated_data ) {
$data['sitegen']['homepages']['data'] = $updated_data;
FlowService::update_data_in_wp_option( $data );
}

public static function reset_error_status( $data ) {
if ( isset( $data['sitegen']['siteGenErrorStatus'] ) && true === $data['sitegen']['siteGenErrorStatus'] ) {
$data['sitegen']['siteGenErrorStatus'] = false;
}

return $data;
}
}

0 comments on commit e471bf9

Please sign in to comment.