Frontend: Event listener fixes

This commit is contained in:
Natty 2023-09-08 19:32:39 +02:00
parent 4ea5d7c106
commit 286c8cfe02
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
2 changed files with 10 additions and 6 deletions

View File

@ -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);
});
</script>

View File

@ -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
);
});