Update unit-list.js

Made change to check for data.units, as without this, when the last unit is removed, this last unit is never removed from the UI.