Owen Diffey преди 3 години
родител
ревизия
4de4e4002f

+ 6 - 0
frontend/src/mixins/ScrollAndFetchHandler.vue

@@ -20,6 +20,12 @@ export default {
 	unmounted() {
 		clearInterval(this.interval);
 	},
+	created() {
+		window.addEventListener("scroll", this.handleScroll);
+	},
+	destroyed() {
+		window.removeEventListener("scroll", this.handleScroll);
+	},
 	methods: {
 		handleScroll() {
 			const scrollPosition = document.body.clientHeight + window.scrollY;

+ 0 - 6
frontend/src/pages/Admin/tabs/HiddenSongs.vue

@@ -241,12 +241,6 @@ export default {
 		if (this.socket.readyState === 1) this.init();
 		ws.onConnect(() => this.init());
 	},
-	created() {
-		window.addEventListener("scroll", this.handleScroll);
-	},
-	destroyed() {
-		window.removeEventListener("scroll", this.handleScroll);
-	},
 	methods: {
 		edit(song) {
 			this.editSong(song);

+ 0 - 6
frontend/src/pages/Admin/tabs/UnverifiedSongs.vue

@@ -251,12 +251,6 @@ export default {
 		if (this.socket.readyState === 1) this.init();
 		ws.onConnect(() => this.init());
 	},
-	created() {
-		window.addEventListener("scroll", this.handleScroll);
-	},
-	destroyed() {
-		window.removeEventListener("scroll", this.handleScroll);
-	},
 	methods: {
 		edit(song) {
 			this.editSong(song);

+ 0 - 6
frontend/src/pages/Admin/tabs/VerifiedSongs.vue

@@ -343,12 +343,6 @@ export default {
 			);
 		}
 	},
-	created() {
-		window.addEventListener("scroll", this.handleScroll);
-	},
-	destroyed() {
-		window.removeEventListener("scroll", this.handleScroll);
-	},
 	methods: {
 		edit(song) {
 			this.editSong(song);