From 345b37a291cdd442cf58d497a49467da32501786 Mon Sep 17 00:00:00 2001 From: Eser DENIZ Date: Thu, 26 Dec 2024 00:09:12 +0100 Subject: [PATCH 1/5] fix: menubar not ready --- src/MenuBar/PendingCreateMenuBar.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/MenuBar/PendingCreateMenuBar.php b/src/MenuBar/PendingCreateMenuBar.php index f07eb561..44ce6bec 100644 --- a/src/MenuBar/PendingCreateMenuBar.php +++ b/src/MenuBar/PendingCreateMenuBar.php @@ -4,13 +4,18 @@ class PendingCreateMenuBar extends MenuBar { + protected bool $created = false; + public function __destruct() { - $this->create(); + if (! $this->created) { + $this->create(); + } } - protected function create(): void + public function create(): void { $this->client->post('menu-bar/create', $this->toArray()); + $this->created = true; } } From 4c89091307cd69b21de429d77ee4fabc432448f9 Mon Sep 17 00:00:00 2001 From: Eser DENIZ Date: Thu, 26 Dec 2024 00:31:46 +0100 Subject: [PATCH 2/5] fix: menubar not ready --- src/MenuBar/PendingCreateMenuBar.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MenuBar/PendingCreateMenuBar.php b/src/MenuBar/PendingCreateMenuBar.php index 44ce6bec..991b0ace 100644 --- a/src/MenuBar/PendingCreateMenuBar.php +++ b/src/MenuBar/PendingCreateMenuBar.php @@ -9,11 +9,11 @@ class PendingCreateMenuBar extends MenuBar public function __destruct() { if (! $this->created) { - $this->create(); + $this->now(); } } - public function create(): void + public function now(): void { $this->client->post('menu-bar/create', $this->toArray()); $this->created = true; From 8d24601f1d659f36977b66b1969bfde6ab311db1 Mon Sep 17 00:00:00 2001 From: Eser DENIZ Date: Sun, 29 Dec 2024 16:18:09 +0100 Subject: [PATCH 3/5] feat: new menubar event --- src/Events/MenuBar/MenuBarCreated.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/Events/MenuBar/MenuBarCreated.php diff --git a/src/Events/MenuBar/MenuBarCreated.php b/src/Events/MenuBar/MenuBarCreated.php new file mode 100644 index 00000000..07891a18 --- /dev/null +++ b/src/Events/MenuBar/MenuBarCreated.php @@ -0,0 +1,21 @@ + Date: Sun, 29 Dec 2024 16:18:36 +0100 Subject: [PATCH 4/5] Revert "fix: menubar not ready" This reverts commit 4c89091307cd69b21de429d77ee4fabc432448f9. --- src/MenuBar/PendingCreateMenuBar.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MenuBar/PendingCreateMenuBar.php b/src/MenuBar/PendingCreateMenuBar.php index 991b0ace..44ce6bec 100644 --- a/src/MenuBar/PendingCreateMenuBar.php +++ b/src/MenuBar/PendingCreateMenuBar.php @@ -9,11 +9,11 @@ class PendingCreateMenuBar extends MenuBar public function __destruct() { if (! $this->created) { - $this->now(); + $this->create(); } } - public function now(): void + public function create(): void { $this->client->post('menu-bar/create', $this->toArray()); $this->created = true; From 5b017d07dcac9342b41be4e95eb6bc0b16eaf974 Mon Sep 17 00:00:00 2001 From: Eser DENIZ Date: Sun, 29 Dec 2024 16:18:36 +0100 Subject: [PATCH 5/5] Revert "fix: menubar not ready" This reverts commit 345b37a291cdd442cf58d497a49467da32501786. --- src/MenuBar/PendingCreateMenuBar.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/MenuBar/PendingCreateMenuBar.php b/src/MenuBar/PendingCreateMenuBar.php index 44ce6bec..f07eb561 100644 --- a/src/MenuBar/PendingCreateMenuBar.php +++ b/src/MenuBar/PendingCreateMenuBar.php @@ -4,18 +4,13 @@ class PendingCreateMenuBar extends MenuBar { - protected bool $created = false; - public function __destruct() { - if (! $this->created) { - $this->create(); - } + $this->create(); } - public function create(): void + protected function create(): void { $this->client->post('menu-bar/create', $this->toArray()); - $this->created = true; } }