mirror of
https://github.com/directus/directus.git
synced 2026-02-01 05:45:09 -05:00
Don't open sidebar on window resize
This commit is contained in:
@@ -26,8 +26,6 @@ import { defineComponent, toRefs, watch, computed, provide } from 'vue';
|
||||
import * as stores from '@/stores';
|
||||
import api, { addTokenToURL } from '@/api';
|
||||
import axios from 'axios';
|
||||
|
||||
import useWindowSize from '@/composables/use-window-size';
|
||||
import setFavicon from '@/utils/set-favicon';
|
||||
|
||||
export default defineComponent({
|
||||
@@ -40,7 +38,7 @@ export default defineComponent({
|
||||
const userStore = useUserStore();
|
||||
const serverStore = useServerStore();
|
||||
|
||||
const { hydrating, sidebarOpen } = toRefs(appStore);
|
||||
const { hydrating } = toRefs(appStore);
|
||||
|
||||
const brandStyle = computed(() => {
|
||||
return {
|
||||
@@ -53,23 +51,6 @@ export default defineComponent({
|
||||
setFavicon(serverStore.info?.project?.project_color || '#00C897', hasCustomLogo);
|
||||
});
|
||||
|
||||
const { width } = useWindowSize();
|
||||
|
||||
watch(
|
||||
width,
|
||||
(newWidth, oldWidth) => {
|
||||
if (newWidth === null || newWidth === 0) return;
|
||||
if (newWidth === oldWidth) return;
|
||||
|
||||
if (newWidth >= 1424) {
|
||||
if (sidebarOpen.value === false) sidebarOpen.value = true;
|
||||
} else {
|
||||
if (sidebarOpen.value === true) sidebarOpen.value = false;
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
watch(
|
||||
() => userStore.currentUser,
|
||||
(newUser) => {
|
||||
|
||||
Reference in New Issue
Block a user