Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion frontend/src/stores/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import { getPublicSettings as fetchPublicSettingsAPI } from '@/api/auth'
export const useAppStore = defineStore('app', () => {
// ==================== State ====================

const sidebarCollapsed = ref<boolean>(false)
const SIDEBAR_COLLAPSED_KEY = 'sidebar_collapsed'
const sidebarCollapsed = ref<boolean>(localStorage.getItem(SIDEBAR_COLLAPSED_KEY) === 'true')
const mobileOpen = ref<boolean>(false)
const loading = ref<boolean>(false)
const toasts = ref<Toast[]>([])
Expand Down Expand Up @@ -58,6 +59,7 @@ export const useAppStore = defineStore('app', () => {
*/
function toggleSidebar(): void {
sidebarCollapsed.value = !sidebarCollapsed.value
localStorage.setItem(SIDEBAR_COLLAPSED_KEY, String(sidebarCollapsed.value))
}

/**
Expand All @@ -66,6 +68,7 @@ export const useAppStore = defineStore('app', () => {
*/
function setSidebarCollapsed(collapsed: boolean): void {
sidebarCollapsed.value = collapsed
localStorage.setItem(SIDEBAR_COLLAPSED_KEY, String(collapsed))
}

/**
Expand Down Expand Up @@ -226,6 +229,7 @@ export const useAppStore = defineStore('app', () => {
loading.value = false
loadingCount.value = 0
toasts.value = []
localStorage.removeItem(SIDEBAR_COLLAPSED_KEY)
}

// ==================== Version Management ====================
Expand Down