luci-mod-system: flash.js: fix passing sysupgrade opts
[project/luci.git] / modules / luci-mod-system / htdocs / luci-static / resources / view / system / flash.js
index 915c3c7fa052d603abec3766dc3830d1a7e10d3b..61e021c28af379fb722d2ecbf455b2fc34b8359d 100644 (file)
@@ -342,7 +342,7 @@ return L.view.extend({
 
                                var cntbtn = E('button', {
                                        'class': 'btn cbi-button-action important',
-                                       'click': L.ui.createHandlerFn(this, 'handleSysupgradeConfirm', btn, keep.checked, force.checked),
+                                       'click': L.ui.createHandlerFn(this, 'handleSysupgradeConfirm', btn, keep, force),
                                        'disabled': (!is_valid || is_too_big) ? true : null
                                }, [ _('Continue') ]);
 
@@ -376,10 +376,10 @@ return L.view.extend({
 
                var opts = [];
 
-               if (!keep)
+               if (!keep.checked)
                        opts.push('-n');
 
-               if (force)
+               if (force.checked)
                        opts.push('--force');
 
                opts.push('/tmp/firmware.bin');