Fix for falsy types

This commit is contained in:
Kavin
2026-03-27 00:55:11 +05:30
parent 5f647ffe2a
commit 3e79a04fe3
3 changed files with 17 additions and 6 deletions

View File

@@ -10,7 +10,7 @@
/>
</div>
<div id="theaterModeSpot" class="-mx-1vw"></div>
<LoadingIndicatorPage :show-content="video && !isEmbed" class="w-full">
<LoadingIndicatorPage :show-content="video != null && !isEmbed" class="w-full">
<ErrorHandler v-if="video && video.error" :message="video.message" :error="video.error" />
<Transition>
<ToastComponent v-if="shouldShowToast" @dismissed="dismiss">
@@ -27,7 +27,7 @@
ref="videoPlayer"
:video="video"
:sponsors="sponsors"
:selected-auto-play="selectedAutoPlay"
:selected-auto-play="selectedAutoPlayEnabled"
:selected-auto-loop="selectedAutoLoop"
@timeupdate="onTimeUpdate"
@ended="onVideoEnded"
@@ -251,7 +251,12 @@
/>
<br />
<label for="chkAutoPlay"><strong v-text="`${$t('actions.auto_play_next_video')}:`" /></label>
<select id="chkAutoPlay" v-model="selectedAutoPlay" class="select ml-1.5" @change="onChange($event)">
<select
id="chkAutoPlay"
v-model.number="selectedAutoPlay"
class="select ml-1.5"
@change="onChange($event)"
>
<option v-t="'actions.never'" value="0" />
<option v-t="'actions.playlists_only'" value="1" />
<option v-t="'actions.always'" value="2" />
@@ -419,6 +424,10 @@ const isListening = computed(() => {
return getPreferenceBoolean("listen", false);
});
const selectedAutoPlayEnabled = computed(() => {
return Number(selectedAutoPlay.value) >= 1;
});
const toggleListenUrl = computed(() => {
const url = new URL(window.location.href);
url.searchParams.set("listen", isListening.value ? "0" : "1");