Skip to content

Commit 345b37a

Browse files
committed
fix: menubar not ready
1 parent 8267087 commit 345b37a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/MenuBar/PendingCreateMenuBar.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44

55
class PendingCreateMenuBar extends MenuBar
66
{
7+
protected bool $created = false;
8+
79
public function __destruct()
810
{
9-
$this->create();
11+
if (! $this->created) {
12+
$this->create();
13+
}
1014
}
1115

12-
protected function create(): void
16+
public function create(): void
1317
{
1418
$this->client->post('menu-bar/create', $this->toArray());
19+
$this->created = true;
1520
}
1621
}

0 commit comments

Comments
 (0)