Skip to content

Commit

Permalink
fix: clear notifications cache when upgrading to v3 data version
Browse files Browse the repository at this point in the history
  • Loading branch information
Dartui committed Jul 11, 2024
1 parent 93da00d commit 061defc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Core/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@

use BracketSpace\Notification\Database\DatabaseService;
use BracketSpace\Notification\Database\NotificationDatabaseService;
use BracketSpace\Notification\Integration\WordPressIntegration;
use BracketSpace\Notification\Interfaces;
use BracketSpace\Notification\Utils\WpObjectHelper;
use BracketSpace\Notification\Store;
use BracketSpace\Notification\Utils\WpObjectHelper;

/**
* Upgrade class
Expand Down Expand Up @@ -347,6 +348,7 @@ public function upgradeToV2()
/**
* Upgrades data to v3.
* - 1. Moves the notifications to custom table.
* - 2. Clears notifications cache.
*
* @since [Next]
* @return void
Expand Down Expand Up @@ -378,5 +380,9 @@ public function upgradeToV3()

NotificationDatabaseService::upsert($notification);
}

// 2. Clears notifications cache.

WordPressIntegration::clearNotificationsCache();
}
}

0 comments on commit 061defc

Please sign in to comment.