From aec0afd86d4bf2bd55009bbeebf3e737bd7b5e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 15 Mar 2018 00:27:07 +0100 Subject: [PATCH] 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 --- src/wizard.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wizard.js b/src/wizard.js index 30e66a8867..1b31c2c899 100644 --- a/src/wizard.js +++ b/src/wizard.js @@ -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)); } });