Skip to content

Commit

Permalink
fix: delete file
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-Guillemin committed Jun 5, 2024
1 parent ec59a78 commit 9f6f36d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/webapp/src/stores/fileStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ export const useFileStore = defineStore('file', () => {
* Delete a file
*/
const deleteFile = (fileId: number): void => {
const index = files.value?.findIndex((file) => file.id === fileId);
if (index && index > -1) files.value?.splice(index, 1);
if (!files.value) return;
const index = files.value.findIndex((file) => file.id === fileId);
if (index > -1) files.value.splice(index, 1);
};

/**
Expand Down

0 comments on commit 9f6f36d

Please sign in to comment.