juci-core: juci-confirm: delay resolv/reject to avoid digest error
authorReidar Cederqvist <reidar.cederqvist@gmail.com>
Fri, 9 Feb 2018 14:53:49 +0000 (15:53 +0100)
committerReidar Cederqvist <reidar.cederqvist@gmail.com>
Fri, 9 Feb 2018 14:53:57 +0000 (15:53 +0100)
juci/src/widgets/juci-confirm.js

index 15b99b4..e1060e8 100644 (file)
@@ -19,9 +19,9 @@ JUCI.app
                                on_button: function(btn, inst){
                                        inst.close();
                                        if(btn.value === "ok")
-                                               def.resolve(true);
+                                               setTimeout(function(){def.resolve(true);}, 0);
                                        else
-                                               def.reject(false);
+                                               setTimeout(function(){def.reject(false);}, 0);
                                }
                        });
                        return def;
@@ -41,7 +41,7 @@ JUCI.app
                        buttons: [ {label: $tr(gettext("Close")), value: "" } ],
                        on_button: function(btn, inst){
                                inst.close();
-                               def.resolve("ok");
+                               setTimeout(function(){def.resolve("ok");}, 0);
                        }
                });
                return def;