diff --git a/changelog/unreleased/enhancement-remember-left-nav-bar-state b/changelog/unreleased/enhancement-remember-left-nav-bar-state new file mode 100644 index 00000000000..71d31a33c47 --- /dev/null +++ b/changelog/unreleased/enhancement-remember-left-nav-bar-state @@ -0,0 +1,8 @@ +Enhancement: Remember left nav bar state + +We've implemented a feature to remember the state of the left navbar. Now, when the user reopens the web application, +the navbar will remain in its last state, either fully open or collapsed, +based on the user's previous interaction with it. + +https://github.com/owncloud/web/pull/10611 +https://github.com/owncloud/web/issues/9613 diff --git a/packages/web-runtime/src/layouts/Application.vue b/packages/web-runtime/src/layouts/Application.vue index acdeaf4f69a..c1375fd56fc 100644 --- a/packages/web-runtime/src/layouts/Application.vue +++ b/packages/web-runtime/src/layouts/Application.vue @@ -45,7 +45,8 @@ import { AppLoadingSpinner, useAppsStore, useAuthStore, - useExtensionRegistry + useExtensionRegistry, + useLocalStorage } from '@ownclouders/web-pkg' import TopBar from '../components/Topbar/TopBar.vue' import MessageBar from '../components/MessageBar.vue' @@ -163,7 +164,7 @@ export default defineComponent({ return unref(navItems).length && !unref(isMobileWidth) }) - const navBarClosed = ref(false) + const navBarClosed = useLocalStorage(`oc_navBarClosed`, false) const setNavBarClosed = (value: boolean) => { navBarClosed.value = value }