Vue lifecycle changes

destroyed -> unmounted, beforeDestroy -> beforeUnmount
This commit is contained in:
N-Pex 2025-05-13 16:12:05 +02:00
parent ae312db784
commit 2c5b386af9
18 changed files with 20 additions and 20 deletions

View file

@ -139,7 +139,7 @@ export default {
document.body.classList.add("dark"); document.body.classList.add("dark");
this.$audioPlayer.setAutoplay(false); this.$audioPlayer.setAutoplay(false);
}, },
beforeDestroy() { beforeUnmount() {
emitter.off('audio-playback-started', this.audioPlaybackStarted); emitter.off('audio-playback-started', this.audioPlaybackStarted);
emitter.off('audio-playback-paused', this.audioPlaybackPaused); emitter.off('audio-playback-paused', this.audioPlaybackPaused);
emitter.off('audio-playback-ended', this.audioPlaybackEnded); emitter.off('audio-playback-ended', this.audioPlaybackEnded);

View file

@ -15,7 +15,7 @@ export default {
}, },
}, },
}, },
destroyed() { unmounted() {
this.unloadSrc(); this.unloadSrc();
}, },
watch: { watch: {

View file

@ -114,7 +114,7 @@ export default {
} }
}); });
}, },
beforeDestroy() { beforeUnmount() {
this.mc.destroy(); this.mc.destroy();
window.onresize = null; window.onresize = null;
}, },

View file

@ -561,7 +561,7 @@ export default {
} }
}, },
beforeDestroy() { beforeUnmount() {
emitter.off('audio-playback-ended', this.audioPlaybackEnded); emitter.off('audio-playback-ended', this.audioPlaybackEnded);
this.$audioPlayer.pause(); this.$audioPlayer.pause();
this.stopRRTimer(); this.stopRRTimer();
@ -571,7 +571,7 @@ export default {
} }
}, },
destroyed() { unmounted() {
this.$matrix.off("Room.timeline", this.onEvent); this.$matrix.off("Room.timeline", this.onEvent);
this.$matrix.off("RoomMember.typing", this.onUserTyping); this.$matrix.off("RoomMember.typing", this.onUserTyping);
}, },

View file

@ -101,7 +101,7 @@ export default {
this.updateMemberCount(); this.updateMemberCount();
}, },
destroyed() { unmounted() {
this.$matrix.off("Room.timeline", this.onEvent); this.$matrix.off("Room.timeline", this.onEvent);
}, },

View file

@ -467,7 +467,7 @@ export default {
// action and set up conversion tracking triggered by Room Joined (once per visit). // action and set up conversion tracking triggered by Room Joined (once per visit).
this.$analytics.event("Invitations", "Join Page Shown"); this.$analytics.event("Invitations", "Join Page Shown");
}, },
destroyed() { unmounted() {
this.$matrix.off("Room.myMembership", this.onMyMembership); this.$matrix.off("Room.myMembership", this.onMyMembership);
}, },
}; };

View file

@ -353,7 +353,7 @@ export default {
this.buildVersion = buildVersion; this.buildVersion = buildVersion;
}, },
destroyed() { unmounted() {
this.$matrix.off("Room.timeline", this.onEvent); this.$matrix.off("Room.timeline", this.onEvent);
}, },

View file

@ -136,7 +136,7 @@ export default {
document.body.classList.add("dark"); document.body.classList.add("dark");
this.$audioPlayer.setAutoplay(false); this.$audioPlayer.setAutoplay(false);
}, },
beforeDestroy() { beforeUnmount() {
document.body.classList.remove("dark"); document.body.classList.remove("dark");
}, },
computed: { computed: {

View file

@ -65,7 +65,7 @@ export default {
} }
} }
}, },
beforeDestroy() { beforeUnmount() {
document.body.classList.remove("dark"); document.body.classList.remove("dark");
}, },
computed: { computed: {

View file

@ -44,7 +44,7 @@ export default {
mounted() { mounted() {
this.event.on("Event.localEventIdReplaced", this.onLocalEventIdReplaced); this.event.on("Event.localEventIdReplaced", this.onLocalEventIdReplaced);
}, },
beforeDestroy() { beforeUnmount() {
this.$audioPlayer.removeListener(this._uid); this.$audioPlayer.removeListener(this._uid);
this.event.off("Event.localEventIdReplaced", this.onLocalEventIdReplaced); this.event.off("Event.localEventIdReplaced", this.onLocalEventIdReplaced);
}, },

View file

@ -86,7 +86,7 @@ export default {
this.reactions = this.timelineSet.relations.getChildEventsForEvent(this.event.getId(), 'm.annotation', 'm.reaction'); this.reactions = this.timelineSet.relations.getChildEventsForEvent(this.event.getId(), 'm.annotation', 'm.reaction');
this.event.on("Event.relationsCreated", this.onRelationsCreated); this.event.on("Event.relationsCreated", this.onRelationsCreated);
}, },
beforeDestroy() { beforeUnmount() {
this.event.off("Event.relationsCreated", this.onRelationsCreated); this.event.off("Event.relationsCreated", this.onRelationsCreated);
if (this.reactions) { if (this.reactions) {
this.reactions.off('Relations.add', this.onAddRelation); this.reactions.off('Relations.add', this.onAddRelation);

View file

@ -79,7 +79,7 @@ export default {
this.room.on("Room.receipt", this.onReceipt); this.room.on("Room.receipt", this.onReceipt);
} }
}, },
beforeDestroy() { beforeUnmount() {
if (this.room) { if (this.room) {
this.room.off("Room.receipt", this.onReceipt); this.room.off("Room.receipt", this.onReceipt);
} }

View file

@ -19,7 +19,7 @@ export default {
mounted() { mounted() {
this.loadAttachmentSource(this.event); this.loadAttachmentSource(this.event);
}, },
beforeDestroy() { beforeUnmount() {
this.loadAttachmentSource(null); // Release this.loadAttachmentSource(null); // Release
}, },
computed: { computed: {

View file

@ -50,7 +50,7 @@ export default {
this.reactions = this.timelineSet.relations.getChildEventsForEvent(this.event.getId(), 'm.annotation', 'm.reaction'); this.reactions = this.timelineSet.relations.getChildEventsForEvent(this.event.getId(), 'm.annotation', 'm.reaction');
this.event.on("Event.relationsCreated", this.onRelationsCreated); this.event.on("Event.relationsCreated", this.onRelationsCreated);
}, },
beforeDestroy() { beforeUnmount() {
this.event.off("Event.relationsCreated", this.onRelationsCreated); this.event.off("Event.relationsCreated", this.onRelationsCreated);
if (this.reactions) { if (this.reactions) {
this.reactions.off('Relations.add', this.onAddRelation); this.reactions.off('Relations.add', this.onAddRelation);

View file

@ -26,10 +26,10 @@ export default {
""; "";
this.updateAnswers(); this.updateAnswers();
}, },
destroyed() { unmounted() {
this.$matrix.off("Room.timeline", this.pollMixinOnEvent); this.$matrix.off("Room.timeline", this.pollMixinOnEvent);
}, },
beforeDestroy() { beforeUnmount() {
if (this.pollResponseRelations) { if (this.pollResponseRelations) {
this.pollResponseRelations.off("Relations.add", this.onAddRelation); this.pollResponseRelations.off("Relations.add", this.onAddRelation);
this.pollResponseRelations = null; this.pollResponseRelations = null;

View file

@ -24,7 +24,7 @@ export default {
this.updateMessageRetention(); this.updateMessageRetention();
}, },
destroyed() { unmounted() {
this.$matrix.off("Room.timeline", this.roomInfoMixinOnEvent); this.$matrix.off("Room.timeline", this.roomInfoMixinOnEvent);
}, },

View file

@ -9,7 +9,7 @@ export default {
this.updateMembers(); this.updateMembers();
}, },
destroyed() { unmounted() {
this.$matrix.off("Room.timeline", this.roomMembersMixinOnEvent); this.$matrix.off("Room.timeline", this.roomMembersMixinOnEvent);
}, },

View file

@ -9,7 +9,7 @@ export default {
mounted() { mounted() {
this.$matrix.on("Room.timeline", this.onRoomTypeMixinEvent); this.$matrix.on("Room.timeline", this.onRoomTypeMixinEvent);
}, },
destroyed() { unmounted() {
this.$matrix.off("Room.timeline", this.onRoomTypeMixinEvent); this.$matrix.off("Room.timeline", this.onRoomTypeMixinEvent);
}, },
watch: { watch: {