mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-27 00:17:31 +00:00
fix(appList): 删除应用后回到聊天选择最后一次对话的应用时提示无该应用bug (#2236)
This commit is contained in:
@@ -39,6 +39,7 @@ import { getTeamMembers } from '@/web/support/user/team/api';
|
|||||||
import { formatTimeToChatTime } from '@fastgpt/global/common/string/time';
|
import { formatTimeToChatTime } from '@fastgpt/global/common/string/time';
|
||||||
import { useSystem } from '@fastgpt/web/hooks/useSystem';
|
import { useSystem } from '@fastgpt/web/hooks/useSystem';
|
||||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||||
|
import { useChatStore } from '@/web/core/chat/context/storeChat';
|
||||||
const HttpEditModal = dynamic(() => import('./HttpPluginEditModal'));
|
const HttpEditModal = dynamic(() => import('./HttpPluginEditModal'));
|
||||||
|
|
||||||
const ListItem = () => {
|
const ListItem = () => {
|
||||||
@@ -47,6 +48,8 @@ const ListItem = () => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { parentId = null } = router.query;
|
const { parentId = null } = router.query;
|
||||||
const { isPc } = useSystem();
|
const { isPc } = useSystem();
|
||||||
|
const { lastChatAppId, setLastChatAppId } = useChatStore();
|
||||||
|
|
||||||
|
|
||||||
const { myApps, loadMyApps, onUpdateApp, setMoveAppId, folderDetail } = useContextSelector(
|
const { myApps, loadMyApps, onUpdateApp, setMoveAppId, folderDetail } = useContextSelector(
|
||||||
AppListContext,
|
AppListContext,
|
||||||
@@ -83,6 +86,9 @@ const ListItem = () => {
|
|||||||
});
|
});
|
||||||
const { runAsync: onclickDelApp } = useRequest2(
|
const { runAsync: onclickDelApp } = useRequest2(
|
||||||
(id: string) => {
|
(id: string) => {
|
||||||
|
if (id === lastChatAppId) {
|
||||||
|
setLastChatAppId('');
|
||||||
|
}
|
||||||
return delAppById(id);
|
return delAppById(id);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user