fix: lazy load catalog

This commit is contained in:
Benjamin Nussbaum 2025-11-12 18:43:26 +01:00
parent 87a73046c5
commit b4d817bc84
3 changed files with 4 additions and 4 deletions

View file

@ -23,7 +23,7 @@ new class extends Component {
$this->catalogPlugins = Cache::remember('catalog_plugins', 43200, function () use ($catalogUrl) { $this->catalogPlugins = Cache::remember('catalog_plugins', 43200, function () use ($catalogUrl) {
try { try {
$response = Http::get($catalogUrl); $response = Http::timeout(10)->get($catalogUrl);
$catalogContent = $response->body(); $catalogContent = $response->body();
$catalog = Yaml::parse($catalogContent); $catalog = Yaml::parse($catalogContent);

View file

@ -22,7 +22,7 @@ new class extends Component {
{ {
try { try {
$this->recipes = Cache::remember('trmnl_recipes_newest', 43200, function () { $this->recipes = Cache::remember('trmnl_recipes_newest', 43200, function () {
$response = Http::get('https://usetrmnl.com/recipes.json', [ $response = Http::timeout(10)->get('https://usetrmnl.com/recipes.json', [
'sort-by' => 'newest', 'sort-by' => 'newest',
]); ]);

View file

@ -286,7 +286,7 @@ new class extends Component {
</flux:heading> </flux:heading>
<flux:subheading>Browse and install Recipes from the community. Add yours <a href="https://github.com/bnussbau/trmnl-recipe-catalog" class="underline" target="_blank">here</a>.</flux:subheading> <flux:subheading>Browse and install Recipes from the community. Add yours <a href="https://github.com/bnussbau/trmnl-recipe-catalog" class="underline" target="_blank">here</a>.</flux:subheading>
</div> </div>
<livewire:catalog.index /> <livewire:catalog.index lazy />
</div> </div>
</flux:modal> </flux:modal>
@ -297,7 +297,7 @@ new class extends Component {
<flux:badge color="yellow" class="ml-2">Alpha</flux:badge> <flux:badge color="yellow" class="ml-2">Alpha</flux:badge>
</flux:heading> </flux:heading>
</div> </div>
<livewire:catalog.trmnl /> <livewire:catalog.trmnl lazy />
</div> </div>
</flux:modal> </flux:modal>