fix: defaults episode count to '-' as an indicator to whether the fetch call has run or not. if there are 0 results after the fetch call, the '-' is updated to '0'

This commit is contained in:
2025-06-20 08:37:35 -05:00
parent 965b747594
commit e39182ba91
2 changed files with 2 additions and 1 deletions

View File

@@ -48,6 +48,7 @@ export default class extends Controller {
this.options.forEach((option) => option.querySelector('.download-btn').dataset['title'] = this.titleValue);
this.options[0].querySelector('input[type="checkbox"]').checked = true;
} else {
this.countTarget.innerText = 0;
this.episodeSelectorTarget.disabled = true;
}
this.loadingIconOutlet.increaseCount();

View File

@@ -33,7 +33,7 @@
<button class="py-1 px-1.5 mr-1 grow-0 font-bold text-xs bg-green-600 rounded-lg hover:cursor-pointer hover:bg-green-700 text-white"
{{ stimulus_action('tv-results', 'toggleList', 'click') }}
>
<span {{ stimulus_target('tv-results', 'count') }}>0</span> results
<span {{ stimulus_target('tv-results', 'count') }}>-</span> results
</button>
<small class="py-1 px-1.5 mr-1 grow-0 font-bold bg-gray-700 rounded-lg font-normal text-white" title="Air date {{ episode['name'] }}">