luci-mod-system: flash.js: fix flash erase modal
[project/luci.git] / modules / luci-mod-system / htdocs / luci-static / resources / view / system / flash.js
index e139ba6617a785afc7575a6c8d9a69288f7fb329..43840f4071eadda5d2cce50db6d95677c476cb32 100644 (file)
@@ -89,16 +89,14 @@ return L.view.extend({
                if (!confirm(_('Do you really want to erase all settings?')))
                        return;
 
-               return fs.exec('/sbin/firstboot', [ '-r', '-y' ]).then(function(res) {
-                       if (res.code != 0)
-                               return L.ui.addNotification(null, E('p', _('The firstboot command failed with code %d').format(res.code)));
+               L.ui.showModal(_('Erasing...'), [
+                       E('p', { 'class': 'spinning' }, _('The system is erasing the configuration partition now and will reboot itself when finished.'))
+               ]);
 
-                       L.ui.showModal(_('Erasing...'), [
-                               E('p', { 'class': 'spinning' }, _('The system is erasing the configuration partition now and will reboot itself when finished.'))
-                       ]);
+               /* Currently the sysupgrade rpc call will not return, hence no promise handling */
+               fs.exec('/sbin/firstboot', [ '-r', '-y' ]);
 
-                       L.ui.awaitReconnect('192.168.1.1', 'openwrt.lan');
-               }).catch(function(e) { L.ui.addNotification(null, E('p', e.message)) });
+               L.ui.awaitReconnect('192.168.1.1', 'openwrt.lan');
        },
 
        handleRestore: function(ev) {