Skip to content

Commit e5d2dbb

Browse files
authored
🐛 The knowledge base page failed to load correctly on its first visit because the indices API was not called
🐛 The knowledge base page failed to load correctly on its first visit because the indices API was not called. #2427
2 parents c1ad2ce + a76bdf9 commit e5d2dbb

File tree

1 file changed

+12
-1
lines changed
  • frontend/app/[locale]/knowledges

1 file changed

+12
-1
lines changed

frontend/app/[locale]/knowledges/page.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { configService } from "@/services/configService";
88
import { configStore } from "@/lib/config";
99
import { USER_ROLES } from "@/const/auth";
1010
import log from "@/lib/logger";
11+
import knowledgeBaseService from "@/services/knowledgeBaseService";
1112

1213
import DataConfig from "./KnowledgeBaseConfiguration";
1314

@@ -36,6 +37,15 @@ export default function KnowledgesContent() {
3637
})
3738
);
3839

40+
// Load knowledge base list from API
41+
const loadKnowledgeBaseList = async () => {
42+
try {
43+
await knowledgeBaseService.getKnowledgeBases(true);
44+
} catch (error) {
45+
log.error("Failed to load knowledge base list:", error);
46+
}
47+
};
48+
3949
// Load config for normal user
4050
const loadConfigForNormalUser = async () => {
4151
if (!isSpeedMode && user && user.role !== USER_ROLES.ADMIN) {
@@ -48,8 +58,9 @@ export default function KnowledgesContent() {
4858
}
4959
};
5060

61+
loadKnowledgeBaseList();
5162
loadConfigForNormalUser();
52-
}, []);
63+
}, [isSpeedMode, user]);
5364

5465
return (
5566
<>

0 commit comments

Comments
 (0)