Wait the promise of Screen.new_ before using current_record
The current_record is only set in a callback of the promise so depending on the timing current_record may not be set at the return of the function. issue7210 review38051002
This commit is contained in:
+4
-3
@@ -151,9 +151,10 @@
|
||||
// TODO toolbar
|
||||
this.widget.append(this.screen.screen_container.el);
|
||||
|
||||
this.screen.new_(false);
|
||||
this.screen.current_record.set_default(defaults);
|
||||
this.screen.set_cursor();
|
||||
this.screen.new_(false).then(function() {
|
||||
this.screen.current_record.set_default(defaults);
|
||||
this.screen.set_cursor();
|
||||
}.bind(this));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user