Skip to content

Commit

Permalink
fix: prevent add duplicated element to array
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Oct 31, 2024
1 parent e47e789 commit d7b3ae3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/store/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export const useFilesStore = function(...args) {
addFile(file) {
set(this.files, file.nodeId, file)
this.hydrateFile(file.nodeId)
this.ordered.push(file.nodeId)
if (!this.ordered.includes(file.nodeId)) {
this.ordered.push(file.nodeId)
}
},
selectFile(nodeId) {
this.selectedNodeId = nodeId ?? 0
Expand Down

0 comments on commit d7b3ae3

Please sign in to comment.