Browse Source

fix: activities would load on scroll on playlist tab

Kristian Vos 1 year ago
parent
commit
1773796921

+ 6 - 0
frontend/src/pages/Profile/Tabs/RecentActivity.vue

@@ -18,6 +18,10 @@ const props = defineProps({
 	userId: {
 		type: String,
 		default: ""
+	},
+	checkScroll: {
+		type: Boolean,
+		default: false
 	}
 });
 
@@ -61,6 +65,8 @@ const getSet = () => {
 };
 
 const handleScroll = () => {
+	if (!props.checkScroll) return false;
+
 	const scrollPosition = document.body.scrollTop + document.body.clientHeight;
 	const bottomPosition = document.body.scrollHeight;
 

+ 2 - 1
frontend/src/pages/Profile/index.vue

@@ -40,7 +40,7 @@ onMounted(() => {
 		route.query.tab === "recent-activity" ||
 		route.query.tab === "playlists"
 	)
-		tab.value = route.query.tab;
+		showTab(route.query.tab);
 
 	socket.onConnect(() => {
 		socket.dispatch("users.getBasicUser", route.params.username, res => {
@@ -169,6 +169,7 @@ onMounted(() => {
 				/>
 				<recent-activity
 					:user-id="userId"
+					:check-scroll="tab === 'recent-activity'"
 					v-show="tab === 'recent-activity'"
 				/>
 			</div>