feat: enhance document loading and state management in doc-content component
- Introduced a loading state (`loadingChunks`) to manage document chunk loading more effectively. - Updated the scroll handling logic to prevent multiple requests while loading chunks. - Adjusted the pagination logic to ensure correct page increments based on the total document count. This update improves the user experience by ensuring smoother document loading and better state management during scrolling interactions.
This commit is contained in:
@@ -109,7 +109,7 @@ func (s *agentService) CreateAgentEngine(
|
||||
|
||||
// Register MCP tools from enabled services for this tenant
|
||||
tenantID := uint64(0)
|
||||
if tid, ok := ctx.Value(types.TenantIDContextKey).(uint64); ok {
|
||||
if tid, ok := types.TenantIDFromContext(ctx); ok {
|
||||
tenantID = tid
|
||||
}
|
||||
if tenantID > 0 && s.mcpServiceService != nil && s.mcpManager != nil {
|
||||
@@ -550,7 +550,7 @@ func (s *agentService) getSelectedDocumentInfos(ctx context.Context, knowledgeID
|
||||
|
||||
// Get tenant ID from context
|
||||
tenantID := uint64(0)
|
||||
if tid, ok := ctx.Value(types.TenantIDContextKey).(uint64); ok {
|
||||
if tid, ok := types.TenantIDFromContext(ctx); ok {
|
||||
tenantID = tid
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user