mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	hide new chat button on sd page
This commit is contained in:
		@@ -152,7 +152,7 @@ export function SideBar(props: { className?: string }) {
 | 
			
		||||
  useHotKey();
 | 
			
		||||
 | 
			
		||||
  let bodyComponent: React.JSX.Element;
 | 
			
		||||
  let isChat: boolean;
 | 
			
		||||
  let isChat: boolean = false;
 | 
			
		||||
  switch (location.pathname) {
 | 
			
		||||
    case Path.Sd:
 | 
			
		||||
      bodyComponent = <SdList />;
 | 
			
		||||
@@ -161,6 +161,7 @@ export function SideBar(props: { className?: string }) {
 | 
			
		||||
      isChat = true;
 | 
			
		||||
      bodyComponent = <ChatList narrow={shouldNarrow} />;
 | 
			
		||||
  }
 | 
			
		||||
  // @ts-ignore
 | 
			
		||||
  return (
 | 
			
		||||
    <div
 | 
			
		||||
      className={`${styles.sidebar} ${props.className} ${
 | 
			
		||||
@@ -240,21 +241,23 @@ export function SideBar(props: { className?: string }) {
 | 
			
		||||
            </a>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div>
 | 
			
		||||
          <IconButton
 | 
			
		||||
            icon={<AddIcon />}
 | 
			
		||||
            text={shouldNarrow ? undefined : Locale.Home.NewChat}
 | 
			
		||||
            onClick={() => {
 | 
			
		||||
              if (config.dontShowMaskSplashScreen) {
 | 
			
		||||
                chatStore.newSession();
 | 
			
		||||
                navigate(Path.Chat);
 | 
			
		||||
              } else {
 | 
			
		||||
                navigate(Path.NewChat);
 | 
			
		||||
              }
 | 
			
		||||
            }}
 | 
			
		||||
            shadow
 | 
			
		||||
          />
 | 
			
		||||
        </div>
 | 
			
		||||
        {isChat && (
 | 
			
		||||
          <div>
 | 
			
		||||
            <IconButton
 | 
			
		||||
              icon={<AddIcon />}
 | 
			
		||||
              text={shouldNarrow ? undefined : Locale.Home.NewChat}
 | 
			
		||||
              onClick={() => {
 | 
			
		||||
                if (config.dontShowMaskSplashScreen) {
 | 
			
		||||
                  chatStore.newSession();
 | 
			
		||||
                  navigate(Path.Chat);
 | 
			
		||||
                } else {
 | 
			
		||||
                  navigate(Path.NewChat);
 | 
			
		||||
                }
 | 
			
		||||
              }}
 | 
			
		||||
              shadow
 | 
			
		||||
            />
 | 
			
		||||
          </div>
 | 
			
		||||
        )}
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <div
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user