Browse Source

Updates to fix merge and remove console.log

pull/27/head
Matthew Raymer 1 year ago
parent
commit
53f42e1ad3
  1. 15
      src/components/InfiniteScroll.vue
  2. 5
      src/views/ProjectsView.vue

15
src/components/InfiniteScroll.vue

@ -40,23 +40,8 @@ export default class InfiniteScroll extends Vue {
@Emit("reached-bottom") @Emit("reached-bottom")
handleIntersection(entries: IntersectionObserverEntry[]) { handleIntersection(entries: IntersectionObserverEntry[]) {
console.log("handleIntersection");
const entry = entries[0]; const entry = entries[0];
if (entry.isIntersecting) { 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 true;
} }
return false; return false;

5
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 * @param payload is the flag from the InfiniteScroll indicating if it should load
**/ **/
async loadMoreData(payload: boolean) { async loadMoreData(payload: boolean) {
console.log(payload); if (this.projects.length > 0 && payload) {
if (this.projects.length > 0) {
const latestProject = this.projects[this.projects.length - 1]; const latestProject = this.projects[this.projects.length - 1];
const url = `${this.apiServer}/api/v2/report/plansByIssuer?beforeId=${latestProject.rowid}`; const url = `${this.apiServer}/api/v2/report/plansByIssuer?beforeId=${latestProject.rowid}`;
const token = await accessToken(this.current); const token = await accessToken(this.current);
@ -202,7 +201,6 @@ export default class ProjectsView extends Vue {
* @param identity of the user * @param identity of the user
**/ **/
async LoadProjects(identity: IIdentifier) { async LoadProjects(identity: IIdentifier) {
console.log("LoadProjects");
const url = `${this.apiServer}/api/v2/report/plansByIssuer`; const url = `${this.apiServer}/api/v2/report/plansByIssuer`;
const token: string = await accessToken(identity); const token: string = await accessToken(identity);
await this.dataLoader(url, token); await this.dataLoader(url, token);
@ -228,6 +226,7 @@ export default class ProjectsView extends Vue {
if (!identity) { if (!identity) {
throw new Error("No identity found."); throw new Error("No identity found.");
} }
this.current = identity;
this.LoadProjects(identity); this.LoadProjects(identity);
} }
} }

Loading…
Cancel
Save