+
{t('share.chat.pinnedTitle')}
0 ? maxListHeight : 'flex-grow')}
currentId={currentId}
onCurrentIdChange={onCurrentIdChange}
list={pinnedList}
+ isClearConversationList={isClearPinnedConversationList}
isInstalledApp={isInstalledApp}
installedAppId={installedAppId}
onMoreLoaded={onPinnedMoreLoaded}
@@ -114,8 +119,8 @@ const Sidebar: FC = ({
)}
{/* unpinned list */}
-
- {hasPinned && (
+
+ {(hasPinned && list.length > 0) && (
{t('share.chat.unpinnedTitle')}
)}
= ({
currentId={currentId}
onCurrentIdChange={onCurrentIdChange}
list={list}
+ isClearConversationList={isClearConversationList}
isInstalledApp={isInstalledApp}
installedAppId={installedAppId}
onMoreLoaded={onMoreLoaded}
@@ -133,6 +139,7 @@ const Sidebar: FC = ({
onDelete={onDelete}
/>
+
© {copyRight} {(new Date()).getFullYear()}
diff --git a/web/app/components/share/chat/sidebar/list/index.tsx b/web/app/components/share/chat/sidebar/list/index.tsx
index 756f89061e..e7796f3d4c 100644
--- a/web/app/components/share/chat/sidebar/list/index.tsx
+++ b/web/app/components/share/chat/sidebar/list/index.tsx
@@ -17,6 +17,7 @@ export type IListProps = {
currentId: string
onCurrentIdChange: (id: string) => void
list: ConversationItem[]
+ isClearConversationList: boolean
isInstalledApp: boolean
installedAppId?: string
onMoreLoaded: (res: { data: ConversationItem[]; has_more: boolean }) => void
@@ -32,6 +33,7 @@ const List: FC
= ({
currentId,
onCurrentIdChange,
list,
+ isClearConversationList,
isInstalledApp,
installedAppId,
onMoreLoaded,
@@ -46,7 +48,7 @@ const List: FC = ({
useInfiniteScroll(
async () => {
if (!isNoMore) {
- const lastId = list[list.length - 1]?.id
+ const lastId = !isClearConversationList ? list[list.length - 1]?.id : undefined
const { data: conversations, has_more }: any = await fetchConversations(isInstalledApp, installedAppId, lastId, isPinned)
onMoreLoaded({ data: conversations, has_more })
}
@@ -63,7 +65,7 @@ const List: FC = ({
return (
- {
- !isCurrent && (
-
e.stopPropagation()}>
- onPinChanged(item.id)}
- isShowDelete
- onDelete={() => onDelete(item.id)}
- />
-
- )
- }
+ {item.id !== '-1' && (
+
e.stopPropagation()}>
+ onPinChanged(item.id)}
+ isShowDelete
+ onDelete={() => onDelete(item.id)}
+ />
+
+ )}