Compare commits

...

6 Commits

Author SHA1 Message Date
Piyush Bhaskar
b5608e08d8 refactor: minor tweak 2025-11-10 22:39:25 +05:30
Piyush Bhaskar
9fb63284f0 fix(core): collapse menu automagically on route change 2025-11-10 22:39:25 +05:30
Piyush Bhaskar
bbd28ad2a8 Revert "fix(ui): auto close sidebar on mobile after clicking a link" 2025-11-10 22:39:25 +05:30
Piyush Bhaskar
32b6e8c6d7 Revert "fix(ui): apply saved sidebar collapse state on first load and route change" 2025-11-10 22:39:25 +05:30
shatrughantwt
93adccb716 fix(ui): apply saved sidebar collapse state on first load and route change 2025-11-10 22:39:25 +05:30
shatrughantwt
b6b854598b fix(ui): auto close sidebar on mobile after clicking a link 2025-11-10 22:39:25 +05:30

View File

@@ -28,16 +28,11 @@
</template>
<script setup lang="ts">
import {
onUpdated,
ref,
computed, h
} from "vue";
import {onUpdated, ref, computed, h, watch} from "vue";
import {useI18n} from "vue-i18n";
import {useRoute} from "vue-router";
import {useMediaQuery} from "@vueuse/core";
import {SidebarMenu} from "vue-sidebar-menu";
import StarOutline from "vue-material-design-icons/StarOutline.vue";
import Environment from "./Environment.vue";
@@ -124,6 +119,14 @@
});
const collapsed = ref(localStorage.getItem("menuCollapsed") === "true")
const isSmallScreen = useMediaQuery("(max-width: 768px)")
watch(() => $route.name, (newRoute, oldRoute) => {
if (newRoute !== oldRoute && isSmallScreen.value && !collapsed.value) {
onToggleCollapse(true)
}
})
</script>
<style scoped lang="scss">