responsiveness improvements

+ extract track context menu handler into a composable
This commit is contained in:
geoffrey45
2022-08-13 17:10:48 +03:00
parent a32d8fe66c
commit 1f374eeda1
23 changed files with 274 additions and 249 deletions
+28
View File
@@ -0,0 +1,28 @@
import { Ref } from "vue";
import useModalStore from "@/stores/modal";
import useQueueStore from "@/stores/queue";
import useContextStore from "@/stores/context";
import { ContextSrc } from "./enums";
import { Track } from "@/interfaces";
import trackContext from "@/contexts/track_context";
export const showTrackContextMenu = (
e: Event,
track: Track,
flag: Ref<boolean>
) => {
const menu = useContextStore();
const options = trackContext(track, useModalStore, useQueueStore);
menu.showContextMenu(e, options, ContextSrc.Track);
flag.value = true;
menu.$subscribe((mutation, state) => {
if (!state.visible) {
flag.value = false;
}
});
};