mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
fix: browser refresh no longer needed after adding recipe
This commit is contained in:
parent
6ea32c4149
commit
7cd4263a1d
1 changed files with 16 additions and 10 deletions
|
|
@ -28,6 +28,20 @@ new class extends Component {
|
|||
'polling_header' => 'nullable|string|max:255',
|
||||
];
|
||||
|
||||
private function refreshPlugins(): void
|
||||
{
|
||||
$userPlugins = auth()->user()?->plugins?->map(function ($plugin) {
|
||||
return $plugin->toArray();
|
||||
})->toArray();
|
||||
|
||||
$this->plugins = array_merge($this->native_plugins, $userPlugins ?? []);
|
||||
}
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$this->refreshPlugins();
|
||||
}
|
||||
|
||||
public function addPlugin(): void
|
||||
{
|
||||
abort_unless(auth()->user() !== null, 403);
|
||||
|
|
@ -45,19 +59,11 @@ new class extends Component {
|
|||
]);
|
||||
|
||||
$this->reset(['name', 'data_stale_minutes', 'data_strategy', 'polling_url', 'polling_verb', 'polling_header']);
|
||||
$this->refreshPlugins();
|
||||
|
||||
Flux::modal('add-plugin')->close();
|
||||
}
|
||||
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$userPlugins = auth()->user()?->plugins?->map(function ($plugin) {
|
||||
return $plugin->toArray();
|
||||
})->toArray();
|
||||
|
||||
$this->plugins = array_merge($this->native_plugins, $userPlugins ?? []);
|
||||
}
|
||||
|
||||
public function seedExamplePlugins(): void
|
||||
{
|
||||
// \Artisan::call('db:seed', ['--class' => 'ExampleRecipesSeeder']);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue