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 { useDialogStore } from "../../stores/dialog";
|
||||
import { computed } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
dayjs.locale("fr");
|
||||
|
||||
|
|
@ -68,6 +69,7 @@ const emits = defineEmits(["update:file", "close:comment"]);
|
|||
const userStore = useUserStore();
|
||||
const api = useApiStore();
|
||||
const dialog = useDialogStore();
|
||||
const { activeTracks } = storeToRefs(useDialogStore());
|
||||
|
||||
// Functions
|
||||
const getStatus = computed(() => {
|
||||
|
|
@ -113,9 +115,16 @@ async function read() {
|
|||
|
||||
async function deleteComment(event) {
|
||||
event.stopPropagation();
|
||||
console.log(comment);
|
||||
const newFile = await api.deleteComment(comment);
|
||||
dialog.updateFile(newFile);
|
||||
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);
|
||||
}
|
||||
if (comment.type === "comment-reply") {
|
||||
emits("close:comment");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue