Commit af1cff62 by lolocoo Committed by GitHub

fix(appList): 删除应用后回到聊天选择最后一次对话的应用时提示无该应用bug (#2236)

parent 37607263
......@@ -39,6 +39,7 @@ import { getTeamMembers } from '@/web/support/user/team/api';
import { formatTimeToChatTime } from '@fastgpt/global/common/string/time';
import { useSystem } from '@fastgpt/web/hooks/useSystem';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import { useChatStore } from '@/web/core/chat/context/storeChat';
const HttpEditModal = dynamic(() => import('./HttpPluginEditModal'));
const ListItem = () => {
......@@ -47,6 +48,8 @@ const ListItem = () => {
const router = useRouter();
const { parentId = null } = router.query;
const { isPc } = useSystem();
const { lastChatAppId, setLastChatAppId } = useChatStore();
const { myApps, loadMyApps, onUpdateApp, setMoveAppId, folderDetail } = useContextSelector(
AppListContext,
......@@ -83,6 +86,9 @@ const ListItem = () => {
});
const { runAsync: onclickDelApp } = useRequest2(
(id: string) => {
if (id === lastChatAppId) {
setLastChatAppId('');
}
return delAppById(id);
},
{
......
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 sign in to comment