This commit is contained in:
parent
9c39e0b7a6
commit
ebd464460c
1 changed files with 11 additions and 2 deletions
|
|
@ -55,6 +55,7 @@ import { useUserStore } from "../../stores/user";
|
||||||
import { useApiStore } from "../../stores/api";
|
import { useApiStore } from "../../stores/api";
|
||||||
import { useDialogStore } from "../../stores/dialog";
|
import { useDialogStore } from "../../stores/dialog";
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
|
import { storeToRefs } from "pinia";
|
||||||
|
|
||||||
dayjs.locale("fr");
|
dayjs.locale("fr");
|
||||||
|
|
||||||
|
|
@ -68,6 +69,7 @@ const emits = defineEmits(["update:file", "close:comment"]);
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const api = useApiStore();
|
const api = useApiStore();
|
||||||
const dialog = useDialogStore();
|
const dialog = useDialogStore();
|
||||||
|
const { activeTracks } = storeToRefs(useDialogStore());
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
const getStatus = computed(() => {
|
const getStatus = computed(() => {
|
||||||
|
|
@ -113,9 +115,16 @@ async function read() {
|
||||||
|
|
||||||
async function deleteComment(event) {
|
async function deleteComment(event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
console.log(comment);
|
|
||||||
const newFile = await api.deleteComment(comment);
|
const newFile = await api.deleteComment(comment);
|
||||||
|
console.log(newFile);
|
||||||
|
if (activeTracks.value.length > 0) {
|
||||||
|
activeTracks.value[0].files = activeTracks.value[0].files.map((file) => {
|
||||||
|
if (file.uuid !== newFile.uuid) return file;
|
||||||
|
return newFile;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
dialog.updateFile(newFile);
|
dialog.updateFile(newFile);
|
||||||
|
}
|
||||||
if (comment.type === "comment-reply") {
|
if (comment.type === "comment-reply") {
|
||||||
emits("close:comment");
|
emits("close:comment");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue