Commit 5a402b5a authored by Joel's avatar Joel

feat: handle remove current conversation

parent 25440279
...@@ -142,6 +142,9 @@ const Main: FC<IMainProps> = ({ ...@@ -142,6 +142,9 @@ const Main: FC<IMainProps> = ({
await delConversation(isInstalledApp, installedAppInfo?.id, toDeleteConversationId) await delConversation(isInstalledApp, installedAppInfo?.id, toDeleteConversationId)
notify({ type: 'success', message: t('common.api.success') }) notify({ type: 'success', message: t('common.api.success') })
hideConfirm() hideConfirm()
if (currConversationId === toDeleteConversationId)
handleConversationIdChange('-1')
noticeUpdateList() noticeUpdateList()
} }
......
...@@ -102,7 +102,7 @@ const Sidebar: FC<ISidebarProps> = ({ ...@@ -102,7 +102,7 @@ const Sidebar: FC<ISidebarProps> = ({
<div className='mt-4 px-4'> <div className='mt-4 px-4'>
<div className='mb-1.5 leading-[18px] text-xs text-gray-500 font-medium uppercase'>{t('share.chat.pinnedTitle')}</div> <div className='mb-1.5 leading-[18px] text-xs text-gray-500 font-medium uppercase'>{t('share.chat.pinnedTitle')}</div>
<List <List
className={maxListHeight} className={cn(list.length > 0 ? maxListHeight : 'flex-grow')}
currentId={currentId} currentId={currentId}
onCurrentIdChange={onCurrentIdChange} onCurrentIdChange={onCurrentIdChange}
list={pinnedList} list={pinnedList}
...@@ -120,7 +120,7 @@ const Sidebar: FC<ISidebarProps> = ({ ...@@ -120,7 +120,7 @@ const Sidebar: FC<ISidebarProps> = ({
)} )}
{/* unpinned list */} {/* unpinned list */}
<div className='mt-4 px-4'> <div className='mt-4 px-4'>
{hasPinned && ( {(hasPinned && list.length > 0) && (
<div className='mb-1.5 leading-[18px] text-xs text-gray-500 font-medium uppercase'>{t('share.chat.unpinnedTitle')}</div> <div className='mb-1.5 leading-[18px] text-xs text-gray-500 font-medium uppercase'>{t('share.chat.unpinnedTitle')}</div>
)} )}
<List <List
...@@ -139,6 +139,7 @@ const Sidebar: FC<ISidebarProps> = ({ ...@@ -139,6 +139,7 @@ const Sidebar: FC<ISidebarProps> = ({
onDelete={onDelete} onDelete={onDelete}
/> />
</div> </div>
</div> </div>
<div className="flex flex-shrink-0 pr-4 pb-4 pl-4"> <div className="flex flex-shrink-0 pr-4 pb-4 pl-4">
<div className="text-gray-400 font-normal text-xs">© {copyRight} {(new Date()).getFullYear()}</div> <div className="text-gray-400 font-normal text-xs">© {copyRight} {(new Date()).getFullYear()}</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment