hide new chat button on sd page

This commit is contained in:
licoy 2024-06-27 16:13:51 +08:00
parent d21481173e
commit 34034be0e3
1 changed files with 19 additions and 16 deletions

View File

@ -152,7 +152,7 @@ export function SideBar(props: { className?: string }) {
useHotKey(); useHotKey();
let bodyComponent: React.JSX.Element; let bodyComponent: React.JSX.Element;
let isChat: boolean; let isChat: boolean = false;
switch (location.pathname) { switch (location.pathname) {
case Path.Sd: case Path.Sd:
bodyComponent = <SdList />; bodyComponent = <SdList />;
@ -161,6 +161,7 @@ export function SideBar(props: { className?: string }) {
isChat = true; isChat = true;
bodyComponent = <ChatList narrow={shouldNarrow} />; bodyComponent = <ChatList narrow={shouldNarrow} />;
} }
// @ts-ignore
return ( return (
<div <div
className={`${styles.sidebar} ${props.className} ${ className={`${styles.sidebar} ${props.className} ${
@ -240,21 +241,23 @@ export function SideBar(props: { className?: string }) {
</a> </a>
</div> </div>
</div> </div>
<div> {isChat && (
<IconButton <div>
icon={<AddIcon />} <IconButton
text={shouldNarrow ? undefined : Locale.Home.NewChat} icon={<AddIcon />}
onClick={() => { text={shouldNarrow ? undefined : Locale.Home.NewChat}
if (config.dontShowMaskSplashScreen) { onClick={() => {
chatStore.newSession(); if (config.dontShowMaskSplashScreen) {
navigate(Path.Chat); chatStore.newSession();
} else { navigate(Path.Chat);
navigate(Path.NewChat); } else {
} navigate(Path.NewChat);
}} }
shadow }}
/> shadow
</div> />
</div>
)}
</div> </div>
<div <div