Skip to content

Commit

Permalink
Merge pull request #1480 from shaangill025/20999_auto_add_conflict
Browse files Browse the repository at this point in the history
20999 - Auto Add Fix: Make Initial Conflicts List Immutable
  • Loading branch information
EPortman authored Jun 26, 2024
2 parents 22126b6 + 5af3f9e commit 7fc1660
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "name-examination",
"version": "1.2.20",
"version": "1.2.21",
"private": true,
"scripts": {
"build": "nuxt generate",
Expand Down
9 changes: 5 additions & 4 deletions app/store/examine/conflicts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,12 @@ export const useConflicts = defineStore('conflicts', () => {
/** Reset selectedConflicts and comparedConflicts and save existing data */
function disableAutoAdd () {
if (!autoAdd.value) {
const initialRun = (prevSelectedConflicts.value.length === 0 && prevComparedConflicts.value.length === 0)
for (const conflict of selectedConflicts.value) {
prevSelectedConflicts.value.push(conflict)
prevComparedConflicts.value.push(conflict)
if (initialRun) {
prevSelectedConflicts.value.push(conflict)
prevComparedConflicts.value.push(conflict)
}
const notConflict = (c: ConflictListItem) =>
c.nrNumber !== conflict.nrNumber
selectedConflicts.value = selectedConflicts.value.filter(notConflict)
Expand All @@ -355,8 +358,6 @@ export const useConflicts = defineStore('conflicts', () => {
if (autoAdd.value) {
selectedConflicts.value = prevSelectedConflicts.value
comparedConflicts.value = prevComparedConflicts.value
prevSelectedConflicts.value = []
prevComparedConflicts.value = []
}
}

Expand Down

0 comments on commit 7fc1660

Please sign in to comment.