move album header color methods to composables

This commit is contained in:
geoffrey45
2022-08-03 01:10:08 +03:00
parent c562e529fd
commit db81ee5de3
8 changed files with 100 additions and 119 deletions
+1 -16
View File
@@ -37,17 +37,13 @@ import Tabs from "@/components/RightSideBar/Tabs.vue";
import useContextStore from "@/stores/context";
import useQStore from "@/stores/queue";
import { isSameRoute } from "@/composables/perks";
import useShortcuts from "@/composables/useKeyboard";
const context_store = useContextStore();
const queue = useQStore();
const app_dom = document.getElementById("app");
const route = useRoute();
const router = useRouter();
// function to add the
queue.readQueue();
useShortcuts(useQStore);
@@ -57,18 +53,7 @@ app_dom.addEventListener("click", (e) => {
}
});
function removeHighlight(route: RouteLocationNormalized) {
setTimeout(() => {
router.push({ name: route.name, params: route.params });
}, 5000);
}
router.afterEach((to, from) => {
const h_hash = to.query.highlight as string;
if (h_hash) removeHighlight(to);
if (isSameRoute(to, from)) return;
router.afterEach(() => {
document.getElementById("acontent")?.scrollTo(0, 0);
});