From 286c8cfe02b4abf19dcfed167dcddd7c7f8e065b Mon Sep 17 00:00:00 2001 From: Natty Date: Fri, 8 Sep 2023 19:32:39 +0200 Subject: [PATCH] Frontend: Event listener fixes --- .../client/src/components/MkFollowApproveButton.vue | 4 ++-- .../frontend/client/src/pages/follow-requests.vue | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/fe_calckey/frontend/client/src/components/MkFollowApproveButton.vue b/fe_calckey/frontend/client/src/components/MkFollowApproveButton.vue index ab6b91c..c5c86fa 100644 --- a/fe_calckey/frontend/client/src/components/MkFollowApproveButton.vue +++ b/fe_calckey/frontend/client/src/components/MkFollowApproveButton.vue @@ -69,11 +69,11 @@ function onFolloweeChange(user: Misskey.entities.User) { } onMounted(() => { - globalEvents.on("followeeProcessed", () => onFolloweeChange(props.user)); + globalEvents.on("followeeProcessed", onFolloweeChange, this); }); onBeforeUnmount(() => { - globalEvents.off("followeeProcessed", () => onFolloweeChange(props.user)); + globalEvents.off("followeeProcessed", onFolloweeChange, this); }); diff --git a/fe_calckey/frontend/client/src/pages/follow-requests.vue b/fe_calckey/frontend/client/src/pages/follow-requests.vue index e2cc0aa..0649251 100644 --- a/fe_calckey/frontend/client/src/pages/follow-requests.vue +++ b/fe_calckey/frontend/client/src/pages/follow-requests.vue @@ -98,14 +98,18 @@ const pagination = { }; onMounted(() => { - globalEvents.on("followeeProcessed", () => - paginationComponent.value.reload() + globalEvents.on( + "followeeProcessed", + paginationComponent.value.reload, + this ); }); onBeforeUnmount(() => { - globalEvents.off("followeeProcessed", () => - paginationComponent.value.reload() + globalEvents.off( + "followeeProcessed", + paginationComponent.value.reload, + this ); });