Merge "Add undefined check to changeIsOpen"
This commit is contained in:
@@ -123,8 +123,8 @@ limitations under the License.
|
||||
return this.getBaseUrl() + '/c/' + changeNum;
|
||||
},
|
||||
|
||||
changeIsOpen(status) {
|
||||
return status === this.ChangeStatus.NEW;
|
||||
changeIsOpen(change) {
|
||||
return change && change.status === this.ChangeStatus.NEW;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
_computeItemNeedsReview(account, change, showReviewedState) {
|
||||
return showReviewedState && !change.reviewed &&
|
||||
!change.work_in_progress &&
|
||||
this.changeIsOpen(change.status) &&
|
||||
this.changeIsOpen(change) &&
|
||||
(!account || account._account_id != change.owner._account_id);
|
||||
},
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@
|
||||
if (!draftSection || !draftSection.results.length) { return; }
|
||||
|
||||
const closedChanges = draftSection.results
|
||||
.filter(change => !this.changeIsOpen(change.status));
|
||||
.filter(change => !this.changeIsOpen(change));
|
||||
if (!closedChanges.length) { return; }
|
||||
|
||||
this._showDraftsBanner = true;
|
||||
|
||||
@@ -592,7 +592,7 @@
|
||||
if (editPatchsetLoaded) {
|
||||
// Only show actions that mutate an edit if an actual edit patch set
|
||||
// is loaded.
|
||||
if (this.changeIsOpen(this.change.status)) {
|
||||
if (this.changeIsOpen(this.change)) {
|
||||
if (editBasedOnCurrentPatchSet) {
|
||||
if (!this.actions.publishEdit) {
|
||||
this.set('actions.publishEdit', PUBLISH_EDIT);
|
||||
@@ -614,7 +614,7 @@
|
||||
this._deleteAndNotify('deleteEdit');
|
||||
}
|
||||
|
||||
if (this.changeIsOpen(this.change.status)) {
|
||||
if (this.changeIsOpen(this.change)) {
|
||||
// Only show edit button if there is no edit patchset loaded and the
|
||||
// file list is not in edit mode.
|
||||
if (editPatchsetLoaded || editMode) {
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
},
|
||||
|
||||
_computeHideStrategy(change) {
|
||||
return !this.changeIsOpen(change.status);
|
||||
return !this.changeIsOpen(change);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
];
|
||||
|
||||
// Get conflicts if change is open and is mergeable.
|
||||
if (this.changeIsOpen(this.change.status) && this.mergeable) {
|
||||
if (this.changeIsOpen(this.change) && this.mergeable) {
|
||||
promises.push(this._getConflicts().then(response => {
|
||||
// Because the server doesn't always return a response and the
|
||||
// template expects an array, always return an array.
|
||||
|
||||
Reference in New Issue
Block a user