|
|
@@ -211,6 +211,9 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
globalStore.setShowMenu(false);
|
|
|
};
|
|
|
|
|
|
+ // 统一的sidebar显示逻辑
|
|
|
+ const shouldShowSidebar = location.search.includes('showMenu=false') ? globalStore.showMenu : true;
|
|
|
+
|
|
|
return (
|
|
|
<>
|
|
|
{
|
|
|
@@ -222,7 +225,7 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
)
|
|
|
}
|
|
|
{
|
|
|
- (location.search.includes('showMenu=false') ? globalStore.showMenu : true) &&
|
|
|
+ shouldShowSidebar &&
|
|
|
<SideBarContainer
|
|
|
onDragStart={onDragStart}
|
|
|
shouldNarrow={shouldNarrow}
|
|
|
@@ -255,9 +258,9 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
chatStore.updateCurrentSession((value) => {
|
|
|
value.appId = globalStore.selectedAppId;
|
|
|
});
|
|
|
- if (isMobileScreen) {
|
|
|
- closeSidebar();
|
|
|
- }
|
|
|
+ // 重置sidebar状态,避免跳转后状态异常
|
|
|
+ globalStore.setShowMenu(false);
|
|
|
+
|
|
|
// 保留重要的URL参数
|
|
|
const currentParams = new URLSearchParams(location.search);
|
|
|
const preservedParams = new URLSearchParams();
|