Ensure that stock builds are saved with a code; ignore builds without codes in comparisons

This commit is contained in:
Cmdr McDonald
2017-04-20 15:10:03 +01:00
parent 1516bd4fc0
commit 684ecfcafd
5 changed files with 25 additions and 13 deletions

View File

@@ -308,7 +308,10 @@ export default class OutfittingPage extends Page {
* Save the current build
*/
_saveBuild() {
const { code, buildName, newBuildName, shipId } = this.state;
const { ship, buildName, newBuildName, shipId } = this.state;
// If this is a stock ship the code won't be set, so ensure that we have it
const code = this.state.code || ship.toString();
Persist.saveBuild(shipId, newBuildName, code);
this._updateRoute(shipId, newBuildName, code);