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:
Cédric Krier
2018-03-15 00:27:07 +01:00
parent d694b17804
commit aec0afd86d
+4 -3
View File
@@ -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));
}
});