Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
// select another address to fill that role. Select the
// first address in the list (that does not match the
// modifed address)
+ let found = false;
this.patron.addresses().some(a => {
if (a.id() !== addr.id()) {
this.patron[addrType + '_address'](a);
- return true;
+ return found = true;
}
});
+
+ if (!found) {
+ // No alternate address was found. Clear the value.
+ this.patron[addrType + '_address'](null);
+ }
+
+ this.patron.ischanged(true);
}
}