Skip to content

Commit

Permalink
Merge pull request #586 from ConvertKit/fix-broadcasts-manual-import-…
Browse files Browse the repository at this point in the history
…description

Broadcasts: Don't display next import date/time when event running
  • Loading branch information
n7studios authored Nov 20, 2023
2 parents ed4b1c8 + 864f452 commit 1547f49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion admin/section/class-convertkit-admin-settings-broadcasts.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ public function register_fields() {

// Define description for the 'Enabled' setting.
// If enabled, include the next scheduled date and time the Plugin will import broadcasts.
// If the next scheduled timestamp is 1, the event is running now.
$enabled_description = '';
if ( $this->settings->enabled() && $posts->get_cron_event_next_scheduled() ) {
if ( $this->settings->enabled() && $posts->get_cron_event_next_scheduled() && $posts->get_cron_event_next_scheduled() > 1 ) {
$enabled_description = sprintf(
'%s %s',
esc_html__( 'Broadcasts will next import at approximately ', 'convertkit' ),
Expand Down
3 changes: 3 additions & 0 deletions tests/acceptance/broadcasts/import/BroadcastsToPostsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ public function testBroadcastsManualImportWhenEnabled(AcceptanceTester $I)
// Confirm a success message displays.
$I->see('Broadcasts import started. Check the Posts screen shortly to confirm Broadcasts imported successfully.');

// Confirm the next scheduled date/time is not displayed, as the event is running.
$I->dontSee('Broadcasts will next import at approximately');

// Wait a few seconds for the Cron event to complete importing Broadcasts.
$I->wait(7);

Expand Down

0 comments on commit 1547f49

Please sign in to comment.