gr-change-view: Skip loading mergeable if already known
The asynchronous mergeable call was added in: I01d03de9f2, and was partly reverted in major refactoring change: I01c87f6f6d7. The part to skip retrieval of mergeable attribute if already provided by changes detail endpoint was missed to be reverted. Bug: Issue 14577 Change-Id: I55e3f32761f0eb484c3b8c3799fd0a6568976017 (cherry picked from commit acb76bdfa491ba7141019c0b8b292e69638a6ab9)
This commit is contained in:
@@ -1871,6 +1871,12 @@ class GrChangeView extends mixinBehaviors( [
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
// If mergeable bit was already returned in detail REST endpoint, use it.
|
||||
if (this._change.mergeable !== undefined) {
|
||||
this._mergeable = this._change.mergeable;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
this._mergeable = null;
|
||||
return this.$.restAPI.getMergeable(this._changeNum).then(m => {
|
||||
this._mergeable = m.mergeable;
|
||||
|
||||
Reference in New Issue
Block a user