From b5fccaa8850341cce16a7eb34601f10e27dff410 Mon Sep 17 00:00:00 2001 From: Roardom Date: Fri, 24 May 2024 06:03:15 +0000 Subject: [PATCH] fix: broken bookmark button This must have been broken for a long time. This also fixes the issue when ticking checkboxes too quickly the state being reset. It required both making sure `small-bookmark-button.blade.php` was surrounded by an element completely, as well as adding wire:key to the inner row loop. Adding wire:key to the component itself doesn't work because the attributes aren't passed through... --- .../views/components/torrent/row.blade.php | 3 ++- .../livewire/small-bookmark-button.blade.php | 20 +++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/resources/views/components/torrent/row.blade.php b/resources/views/components/torrent/row.blade.php index 9e97af1f1b..50bcdb73ba 100644 --- a/resources/views/components/torrent/row.blade.php +++ b/resources/views/components/torrent/row.blade.php @@ -19,6 +19,7 @@ data-category-id="{{ $torrent->category_id }}" data-type-id="{{ $torrent->type_id }}" data-resolution-id="{{ $torrent->resolution_id }}" + wire:key="torrent-search-row-{{ $torrent->id }}" > @if (auth()->user()->show_poster == 1) @@ -141,7 +142,7 @@ class="torrent-search--list__edit form__standard-icon-button" @endif - {{-- @livewire('small-bookmark-button', ['torrent' => $torrent, 'isBookmarked' => $torrent->bookmarks_exists, 'user' => auth()->user()], key('torrent-'.$torrent->id)) --}} + @livewire('small-bookmark-button', ['torrent' => $torrent, 'isBookmarked' => $torrent->bookmarks_exists, 'user' => auth()->user()], key('bookmark-torrent-'.$torrent->id)) @if (config('torrent.download_check_page')) isBookmarked) - -@else - -@endif + @endif +