From 61d5f2b08c1834972f9bcd2ca82391885dee720e Mon Sep 17 00:00:00 2001 From: NandkishorJadoun <183695114+NandkishorJadoun@users.noreply.github.com> Date: Fri, 9 Jan 2026 14:54:54 +0530 Subject: [PATCH] feat: disable toggle starred to maintain consistency --- docs/.vitepress/theme/components/ToggleIndexes.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/.vitepress/theme/components/ToggleIndexes.vue b/docs/.vitepress/theme/components/ToggleIndexes.vue index 61e13c4c4..706ae08fd 100644 --- a/docs/.vitepress/theme/components/ToggleIndexes.vue +++ b/docs/.vitepress/theme/components/ToggleIndexes.vue @@ -2,10 +2,13 @@ import { onBeforeUnmount, onMounted, ref } from 'vue' import Switch from './Switch.vue' +const isDisabled = ref(false) const isOn = ref(false) const syncState = () => { - isOn.value = document.documentElement.classList.contains('indexes-only') + const root = document.documentElement + isDisabled.value = root.classList.contains('starred-only') + isOn.value = root.classList.contains('indexes-only') } let observer: MutationObserver | undefined @@ -22,6 +25,11 @@ onMounted(syncState) onBeforeUnmount(() => observer?.disconnect()) const toggleIndexes = (value: boolean) => { + if (isDisabled.value) { + isOn.value = document.documentElement.classList.contains('indexes-only') + return + } + const root = document.documentElement const enabling = value const wasStarred = root.classList.contains('starred-only') @@ -47,7 +55,9 @@ const toggleIndexes = (value: boolean) => {