We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f582f14 commit d8599bdCopy full SHA for d8599bd
1 file changed
modules/ppcp-store-sync/src/Registration/ReconciliationService.php
@@ -41,12 +41,21 @@ public function reconcile(): void {
41
$desired = $this->settings->should_initialize_features();
42
$actual = $this->registration->is_registered();
43
44
- if ( $desired && ! $actual ) {
45
- if ( $this->should_auto_register() ) {
46
- $this->register();
47
- }
48
- } elseif ( ! $desired && $actual ) {
+ // State has not changed, do nothing.
+ if ( $desired === $actual ) {
+ return;
+ }
+
49
+ // Integration was disabled, clean up and unregister.
50
+ if ( ! $desired ) {
51
$this->registration->deregister();
52
53
54
55
56
+ // Integration is enabled, let's check te auto-register flag before acting.
57
+ if ( $this->should_auto_register() ) {
58
+ $this->register();
59
}
60
61
0 commit comments