diff --git a/src/components/EntityGrid.vue b/src/components/EntityGrid.vue index c2ae4fde..1a964d8c 100644 --- a/src/components/EntityGrid.vue +++ b/src/components/EntityGrid.vue @@ -222,7 +222,6 @@ export default class EntityGrid extends Vue { displayedCount = INITIAL_BATCH_SIZE; infiniteScrollReset?: () => void; scrollContainer?: HTMLElement; - isLoadingMore = false; // Prevent duplicate callback calls /** * Array of entities to display @@ -302,23 +301,6 @@ export default class EntityGrid extends Vue { entityType: "people" | "projects", ) => Contact[] | PlanData[]; - /** - * Optional callback function to load more entities from server - * Called when infinite scroll reaches end and more data is available - * Required for projects when using server-side pagination - * - * @param entities - Current array of entities - * @returns Promise that resolves when more entities are loaded - * - * @example - * :load-more-callback="async (entities) => { - * const lastEntity = entities[entities.length - 1]; - * await loadMoreFromServer(lastEntity.rowId); - * }" - */ - @Prop({ default: null }) - loadMoreCallback?: (entities: Contact[] | PlanData[]) => Promise; - /** * CSS classes for the empty state message */ @@ -807,15 +789,6 @@ export default class EntityGrid extends Vue { !!beforeId && !this.isLoadingProjects; - // Also check if loadMoreCallback is provided (for backward compatibility) - if ( - this.entities && - this.displayedCount >= this.entities.length && - this.loadMoreCallback - ) { - return !this.isLoadingMore; - } - return hasMoreLoaded || canLoadMoreFromServer; } @@ -928,25 +901,6 @@ export default class EntityGrid extends Vue { } finally { this.isLoadingProjects = false; } - } else if ( - this.entities && - this.displayedCount >= this.entities.length && - this.loadMoreCallback && - !this.isLoadingMore - ) { - // Backward compatibility: use loadMoreCallback if provided - this.isLoadingMore = true; - try { - await this.loadMoreCallback(this.entities); - // After callback, entities prop will update via Vue reactivity - // Reset scroll state to allow further loading - this.infiniteScrollReset?.(); - } catch (error) { - // Error handling is up to the callback, but we should reset loading state - logger.error("Error in loadMoreCallback:", error); - } finally { - this.isLoadingMore = false; - } } else { // Normal case: increment displayedCount to show more from memory this.displayedCount += INCREMENT_SIZE;