feat(sidebar): surface unlock entry

This commit is contained in:
aits2026
2026-03-06 12:55:08 +08:00
parent 80a193a394
commit c108070696
2 changed files with 25 additions and 12 deletions

View File

@@ -1,4 +1,5 @@
import { useState, useEffect, useRef } from 'react'
import { useLocation } from 'react-router-dom'
import { useAppStore } from '../stores/appStore'
import { useChatStore } from '../stores/chatStore'
import { useThemeStore, themes } from '../stores/themeStore'
@@ -45,6 +46,7 @@ interface WxidOption {
}
function SettingsPage() {
const location = useLocation()
const {
isDbConnected,
setDbConnected,
@@ -209,6 +211,12 @@ function SettingsPage() {
}
}, [])
useEffect(() => {
const initialTab = (location.state as { initialTab?: SettingsTab } | null)?.initialTab
if (!initialTab) return
setActiveTab(initialTab)
}, [location.state])
// 点击外部关闭下拉框
useEffect(() => {
const handleClickOutside = (e: MouseEvent) => {