mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
highlight the selected when you go to folder
This commit is contained in:
@@ -16,16 +16,21 @@ import FolderList from "@/components/FolderView/FolderList.vue";
|
||||
|
||||
import useFStore from "../stores/pages/folder";
|
||||
import useLoaderStore from "../stores/loader";
|
||||
import { isSameRoute } from "@/composables/perks";
|
||||
|
||||
const loader = useLoaderStore();
|
||||
const FStore = useFStore();
|
||||
|
||||
const scrollable = ref(null);
|
||||
|
||||
onBeforeRouteUpdate((to) => {
|
||||
onBeforeRouteUpdate((to, from) => {
|
||||
if (isSameRoute(to, from)) return;
|
||||
|
||||
loader.startLoading();
|
||||
FStore.fetchAll(to.params.path as string)
|
||||
|
||||
.then(() => {
|
||||
console.log("fetched");
|
||||
scrollable.value.scrollTop = 0;
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Page :onBottomRaised="fetchAlbumBio">
|
||||
<Page :bottomRaisedCallback="fetchAlbumBio">
|
||||
<template #header>
|
||||
<Header :album="album.info" />
|
||||
</template>
|
||||
@@ -13,14 +13,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onBeforeRouteUpdate, RouteLocationNormalized, RouteParams } from "vue-router";
|
||||
import useAStore from "@/stores/pages/album";
|
||||
import { onBeforeRouteUpdate, RouteLocationNormalized, RouteParams } from "vue-router";
|
||||
|
||||
import Page from "@/layouts/HeaderContentBottom.vue";
|
||||
import Header from "./Header.vue";
|
||||
import Content from "./Content.vue";
|
||||
import Bottom from "./Bottom.vue";
|
||||
import { onBeforeUnmount } from "vue";
|
||||
import Content from "./Content.vue";
|
||||
import Header from "./Header.vue";
|
||||
|
||||
const album = useAStore();
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ const playlist = usePTrackStore();
|
||||
onMounted(() => {
|
||||
playlist.fetchArtists(route.params.pid as string);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
|
||||
Reference in New Issue
Block a user