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(() => { onMounted(() => {
globalEvents.on("followeeProcessed", () => onFolloweeChange(props.user)); globalEvents.on("followeeProcessed", onFolloweeChange, this);
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {
globalEvents.off("followeeProcessed", () => onFolloweeChange(props.user)); globalEvents.off("followeeProcessed", onFolloweeChange, this);
}); });
</script> </script>

View File

@ -98,14 +98,18 @@ const pagination = {
}; };
onMounted(() => { onMounted(() => {
globalEvents.on("followeeProcessed", () => globalEvents.on(
paginationComponent.value.reload() "followeeProcessed",
paginationComponent.value.reload,
this
); );
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {
globalEvents.off("followeeProcessed", () => globalEvents.off(
paginationComponent.value.reload() "followeeProcessed",
paginationComponent.value.reload,
this
); );
}); });