「显示更早」读取失败时补上项目路径守卫

- apps/ai-game-creator-shell/src/view/project-development/chat/controller/useDirectProjectChatController.ts 的历史分页 catch 在写 statusNotice 前先比对 projectPathRef.current
- 与成功路径和首个屏幕加载一致;原先切换项目后旧项目在飞读取的失败会显示成新项目的错误
This commit is contained in:
2026-09-19 23:15:15 +08:00
parent 9243bb42a1
commit 8aa737e032
@@ -743,6 +743,8 @@ export function useDirectProjectChatController({
pages.firstItemId ?? historyOldestItemIdRef.current;
if (pages.error) throw pages.error;
} catch (error) {
// 与加载成功路径同样按项目守卫:切项目后在飞的读取失败不能算到新项目头上。
if (projectPathRef.current !== nextProjectPath) return;
setStatusNotice(
`读取更早的对话历史失败:${
error instanceof Error ? error.message : String(error)