mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
loop backwards
This commit is contained in:
committed by
Aiden McClelland
parent
698b0d97e5
commit
2bbb4206ea
@@ -237,11 +237,11 @@ export class FormObjectComponent {
|
|||||||
private updateEnumList (key: string, current: string[], updated: string[]) {
|
private updateEnumList (key: string, current: string[], updated: string[]) {
|
||||||
this.formGroup.get(key).markAsDirty()
|
this.formGroup.get(key).markAsDirty()
|
||||||
|
|
||||||
current.forEach((val, index) => {
|
for (let i = current.length - 1; i >= 0; i--) {
|
||||||
if (!updated.includes(val)) {
|
if (!updated.includes(current[i])) {
|
||||||
this.deleteListItem(key, index, false)
|
this.deleteListItem(key, i, false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
updated.forEach(val => {
|
updated.forEach(val => {
|
||||||
if (!current.includes(val)) {
|
if (!current.includes(val)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user