Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Fix service loading issue in project select page

Andras Bacsai1cb6d594d03a
diff --git a/app/Http/Livewire/Project/New/Select.php b/app/Http/Livewire/Project/New/Select.php
index 934afd9df1..13fbb88862 100644
--- a/app/Http/Livewire/Project/New/Select.php
+++ b/app/Http/Livewire/Project/New/Select.php
@@ -47,6 +47,7 @@ class Select extends Component
}
public function render()
{
+ if ($this->search) $this->loadServices();
return view('livewire.project.new.select');
}
@@ -68,10 +69,10 @@ class Select extends Component
// }
// }
- public function loadServices(bool $force = false)
+ public function loadServices()
{
try {
- if (count($this->allServices) > 0 && !$force) {
+ if (count($this->allServices) > 0) {
if (!$this->search) {
$this->services = $this->allServices;
return;
diff --git a/resources/views/livewire/project/new/select.blade.php b/resources/views/livewire/project/new/select.blade.php
index 9ffa76e74b..60da34cd1d 100644
--- a/resources/views/livewire/project/new/select.blade.php
+++ b/resources/views/livewire/project/new/select.blade.php
@@ -145,9 +145,9 @@
</div>
</div> --}}
</div>
- <div class="flex items-center gap-2" wire:init='loadServices(true)'>
+ <div class="flex items-center gap-2" wire:init='loadServices'>
<h2 class="py-4">Services</h2>
- <x-forms.button wire:click='loadServices(true)'>Reload Services List</x-forms.button>
+ <x-forms.button wire:click='loadServices'>Reload Services List</x-forms.button>
<input
class="w-full text-white rounded input input-sm bg-coolgray-200 disabled:bg-coolgray-200/50 disabled:border-none placeholder:text-coolgray-500 read-only:text-neutral-500 read-only:bg-coolgray-200/50"
wire:model.debounce.200ms="search" placeholder="Search..."></input>