luci-app-attendedsysupgrade: fix search for x86 target 6638/head
authorMiguel Angel Mulero Martinez <migmul@gmail.com>
Thu, 19 Oct 2023 09:49:57 +0000 (11:49 +0200)
committerMiguel Angel Mulero Martinez <migmul@gmail.com>
Thu, 19 Oct 2023 10:56:51 +0000 (12:56 +0200)
The conditional is wrong. IndexOf returns a number and not true/false,
so it does not work.

Signed-off-by: Miguel Angel Mulero Martinez <migmul@gmail.com>
applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js

index 7b067d7e8da9638e1ff0877dab2a58dbdcad188e..450af354967b78510c8b2e9130e83fd5b82ae6c3 100644 (file)
@@ -89,7 +89,7 @@ return view.extend({
                for (image of images) {
                        if (this.firmware.filesystem == image.filesystem) {
                                // x86 images can be combined-efi (EFI) or combined (BIOS)
-                               if(this.firmware.target.indexOf("x86")) {
+                               if(this.firmware.target.indexOf("x86") != -1) {
                                        if (this.data.efi && image.type == 'combined-efi') {
                                                return image;
                                        } else if (image.type == 'combined') {