Browse Source

fix: navigation between settings and home

Yifei Zhang 2 years ago
parent
commit
2badfbd619
1 changed files with 8 additions and 2 deletions
  1. 8 2
      app/components/home.tsx

+ 8 - 2
app/components/home.tsx

@@ -400,7 +400,10 @@ export function Home() {
             <div className={styles["sidebar-action"]}>
               <IconButton
                 icon={<SettingsIcon />}
-                onClick={() => setOpenSettings(!openSettings)}
+                onClick={() => {
+                  setOpenSettings(true)
+                  setShowSideBar(false)
+                }}
               />
             </div>
             <div className={styles["sidebar-action"]}>
@@ -421,7 +424,10 @@ export function Home() {
 
       <div className={styles["window-content"]}>
         {openSettings ? (
-          <Settings closeSettings={() => setOpenSettings(false)} />
+          <Settings closeSettings={() => {
+            setOpenSettings(false)
+            setShowSideBar(true)
+          }} />
         ) : (
           <Chat key="chat" showSideBar={() => setShowSideBar(true)} />
         )}