diff --git a/packages/nc-gui-v2/.eslintrc.js b/packages/nc-gui-v2/.eslintrc.js index ffce177519..140e59ec6a 100644 --- a/packages/nc-gui-v2/.eslintrc.js +++ b/packages/nc-gui-v2/.eslintrc.js @@ -9,4 +9,5 @@ module.exports = { extends: ['@antfu', 'plugin:prettier/recommended'], plugins: ['prettier'], rules: baseRules, + ignorePatterns: ['!*.d.ts'], } diff --git a/packages/nc-gui-v2/app.vue b/packages/nc-gui-v2/app.vue index 812e5cc107..d56cfb3174 100644 --- a/packages/nc-gui-v2/app.vue +++ b/packages/nc-gui-v2/app.vue @@ -3,35 +3,35 @@ import MdiAt from '~icons/mdi/at' import MdiLogout from '~icons/mdi/logout' import MdiDotsVertical from '~icons/mdi/dots-vertical' import MaterialSymbolsMenu from '~icons/material-symbols/menu' +import MdiReload from '~icons/mdi/reload' import { navigateTo } from '#app' +import { useGlobal } from '#imports' -const { $state } = useNuxtApp() +const state = useGlobal() const sidebar = ref() -const email = computed(() => $state.user?.value?.email ?? '---') +const email = computed(() => state.user.value?.email ?? '---') const signOut = () => { - $state.signOut() + state.signOut() navigateTo('/signin') } -const toggleSidebar = useToggle($state.sidebarOpen) - -const sidebarOpen = computed({ - get: () => !$state.sidebarOpen.value, - set: (val) => toggleSidebar(val), +const sidebarCollapsed = computed({ + get: () => !state.sidebarOpen.value, + set: (val) => (state.sidebarOpen.value = !val), }) + +const toggleSidebar = () => { + sidebarCollapsed.value = !sidebarCollapsed.value +}