Fix for theme switching.

Closes #4175
Closes #4177
This commit is contained in:
Kavin
2026-03-28 11:41:16 +05:30
parent 9a05e3991e
commit 2386d728e6
4 changed files with 10 additions and 8 deletions

View File

@@ -1,5 +1,7 @@
@import "tailwindcss"; @import "tailwindcss";
@custom-variant dark (&:where(.dark, .dark *));
@theme { @theme {
--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

View File

@@ -38,7 +38,7 @@
@click="$emit('seek', chapter.start)" @click="$emit('seek', chapter.start)"
> >
<span class="w-5 shrink-0 text-center text-xs" v-text="index + 1" /> <span class="w-5 shrink-0 text-center text-xs" v-text="index + 1" />
<img class="h-10 w-16 shrink-0 rounded object-cover" :src="chapter.image" :alt="chapter.title" /> <img class="h-10 w-16 shrink-0 rounded-sm object-cover" :src="chapter.image" :alt="chapter.title" />
<div class="flex min-w-0 flex-col"> <div class="flex min-w-0 flex-col">
<span class="truncate text-sm" :title="chapter.title" v-text="chapter.title" /> <span class="truncate text-sm" :title="chapter.title" v-text="chapter.title" />
<span class="text-xs font-bold text-blue-500" v-text="timeFormat(chapter.start)" /> <span class="text-xs font-bold text-blue-500" v-text="timeFormat(chapter.start)" />
@@ -53,13 +53,13 @@
<div <div
v-for="(chapter, index) in chapters" v-for="(chapter, index) in chapters"
:key="chapter.start" :key="chapter.start"
class="w-32 flex-none cursor-pointer rounded p-1" class="w-32 flex-none cursor-pointer rounded-sm p-1"
:class="{ 'bg-red-500/50': isCurrentChapter(index) }" :class="{ 'bg-red-500/50': isCurrentChapter(index) }"
@click="$emit('seek', chapter.start)" @click="$emit('seek', chapter.start)"
> >
<img class="aspect-video w-full rounded object-cover" :src="chapter.image" :alt="chapter.title" /> <img class="aspect-video w-full rounded-sm object-cover" :src="chapter.image" :alt="chapter.title" />
<div class="mt-1 px-0.5"> <div class="mt-1 px-0.5">
<span class="line-clamp-2 text-xs leading-tight" :title="chapter.title" v-text="chapter.title" /> <span class="line-clamp-2 text-xs/tight" :title="chapter.title" v-text="chapter.title" />
<span class="text-xs font-bold text-blue-500" v-text="timeFormat(chapter.start)" /> <span class="text-xs font-bold text-blue-500" v-text="timeFormat(chapter.start)" />
</div> </div>
</div> </div>

View File

@@ -147,7 +147,6 @@ import ClearButton from "./ui/ClearButton.vue";
import hotkeys from "hotkeys-js"; import hotkeys from "hotkeys-js";
import { fetchJson, authApiUrl, getAuthToken } from "@/composables/useApi.js"; import { fetchJson, authApiUrl, getAuthToken } from "@/composables/useApi.js";
import { getPreferenceBoolean, getPreferenceString } from "@/composables/usePreferences.js"; import { getPreferenceBoolean, getPreferenceString } from "@/composables/usePreferences.js";
import { getHomePage } from "@/composables/useMisc.js";
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
@@ -158,9 +157,10 @@ const searchSuggestions = ref(null);
const searchText = ref(""); const searchText = ref("");
const suggestionsVisible = ref(false); const suggestionsVisible = ref(false);
const showTopNav = ref(false); const showTopNav = ref(false);
const homePagePath = ref(import.meta.env.BASE_URL);
const registrationDisabled = ref(false); const registrationDisabled = ref(false);
const homePagePath = import.meta.env.BASE_URL;
const shouldShowLogin = computed(() => { const shouldShowLogin = computed(() => {
return getAuthToken() == null; return getAuthToken() == null;
}); });
@@ -253,7 +253,6 @@ onMounted(() => {
fetchAuthConfig(); fetchAuthConfig();
updateSearchTextFromURLSearchParams(); updateSearchTextFromURLSearchParams();
focusOnSearchBar(); focusOnSearchBar();
homePagePath.value = getHomePage();
}); });
</script> </script>

View File

@@ -1,10 +1,11 @@
import { createRouter, createWebHistory } from "vue-router"; import { createRouter, createWebHistory } from "vue-router";
import { getHomePage } from "@/composables/useMisc.js";
const routes = [ const routes = [
{ {
path: "/", path: "/",
name: "Home", name: "Home",
component: () => import("../components/TrendingPage.vue"), redirect: () => getHomePage() ?? "/trending",
}, },
{ {
path: "/trending", path: "/trending",