fix: remove the handleScroll function that tries to automatically optain next discussion
Problem is that the function increase wrongly the page.value Partially solves #1688
This commit is contained in:
@@ -163,14 +163,7 @@ import {
|
|||||||
gql,
|
gql,
|
||||||
} from "@apollo/client/core";
|
} from "@apollo/client/core";
|
||||||
import { useMutation, useQuery } from "@vue/apollo-composable";
|
import { useMutation, useQuery } from "@vue/apollo-composable";
|
||||||
import {
|
import { defineAsyncComponent, ref, computed, inject } from "vue";
|
||||||
defineAsyncComponent,
|
|
||||||
onMounted,
|
|
||||||
onUnmounted,
|
|
||||||
ref,
|
|
||||||
computed,
|
|
||||||
inject,
|
|
||||||
} from "vue";
|
|
||||||
import { useHead } from "@/utils/head";
|
import { useHead } from "@/utils/head";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { useCurrentActorClient } from "@/composition/apollo/actor";
|
import { useCurrentActorClient } from "@/composition/apollo/actor";
|
||||||
@@ -456,30 +449,6 @@ const handleErrors = async (errors: AbsintheGraphQLError[]): Promise<void> => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
window.addEventListener("scroll", handleScroll);
|
|
||||||
});
|
|
||||||
|
|
||||||
onUnmounted(() => {
|
|
||||||
window.removeEventListener("scroll", handleScroll);
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleScroll = (): void => {
|
|
||||||
const scrollTop =
|
|
||||||
(document.documentElement && document.documentElement.scrollTop) ||
|
|
||||||
document.body.scrollTop;
|
|
||||||
const scrollHeight =
|
|
||||||
(document.documentElement && document.documentElement.scrollHeight) ||
|
|
||||||
document.body.scrollHeight;
|
|
||||||
const clientHeight =
|
|
||||||
document.documentElement.clientHeight || window.innerHeight;
|
|
||||||
const scrolledToBottom =
|
|
||||||
Math.ceil(scrollTop + clientHeight + 800) >= scrollHeight;
|
|
||||||
if (scrolledToBottom) {
|
|
||||||
loadMoreComments();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const isCurrentActorAGroupModerator = computed((): boolean => {
|
const isCurrentActorAGroupModerator = computed((): boolean => {
|
||||||
return hasCurrentActorThisRole([
|
return hasCurrentActorThisRole([
|
||||||
MemberRole.MODERATOR,
|
MemberRole.MODERATOR,
|
||||||
|
|||||||
Reference in New Issue
Block a user