From 53f42e1ad3463b0904b447d81a87eff44fbcee58 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Tue, 27 Jun 2023 20:07:38 +0800 Subject: [PATCH] Updates to fix merge and remove console.log --- src/components/InfiniteScroll.vue | 15 --------------- src/views/ProjectsView.vue | 5 ++--- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/components/InfiniteScroll.vue b/src/components/InfiniteScroll.vue index 3baf32a60..39b969e63 100644 --- a/src/components/InfiniteScroll.vue +++ b/src/components/InfiniteScroll.vue @@ -40,23 +40,8 @@ export default class InfiniteScroll extends Vue { @Emit("reached-bottom") handleIntersection(entries: IntersectionObserverEntry[]) { - console.log("handleIntersection"); const entry = entries[0]; if (entry.isIntersecting) { - const distance = entry.boundingClientRect.top - entry.rootBounds.top; - console.log("distance: ", distance); - console.log("intersectionRatio", entry.intersectionRatio); - const sentinelPosition = ( - this.$refs.sentinel as HTMLElement - ).getBoundingClientRect(); - // Access sentinel element's position properties - const sentinelTop = sentinelPosition.top; - console.log("sentinelTop", sentinelTop); - const scrollContainer = ( - this.$refs.scrollContainer as HTMLElement - ).getBoundingClientRect(); - // Access scrollContainer properties or perform any necessary actions - console.log("scrollContainerTop", scrollContainer); return true; } return false; diff --git a/src/views/ProjectsView.vue b/src/views/ProjectsView.vue index 1a81cafa5..df6c82469 100644 --- a/src/views/ProjectsView.vue +++ b/src/views/ProjectsView.vue @@ -176,8 +176,7 @@ export default class ProjectsView extends Vue { * @param payload is the flag from the InfiniteScroll indicating if it should load **/ async loadMoreData(payload: boolean) { - console.log(payload); - if (this.projects.length > 0) { + if (this.projects.length > 0 && payload) { const latestProject = this.projects[this.projects.length - 1]; const url = `${this.apiServer}/api/v2/report/plansByIssuer?beforeId=${latestProject.rowid}`; const token = await accessToken(this.current); @@ -202,7 +201,6 @@ export default class ProjectsView extends Vue { * @param identity of the user **/ async LoadProjects(identity: IIdentifier) { - console.log("LoadProjects"); const url = `${this.apiServer}/api/v2/report/plansByIssuer`; const token: string = await accessToken(identity); await this.dataLoader(url, token); @@ -228,6 +226,7 @@ export default class ProjectsView extends Vue { if (!identity) { throw new Error("No identity found."); } + this.current = identity; this.LoadProjects(identity); } }