Add fixes for cold reboot

This fixes the cold reboot issue with the following steps

- It applies the command to shut off the chassis.
- Then verify the chassis is off. It checks for every 5 seconds.
  During this time the spinner displays. A 5min timeout has been
  added.
- Once the chassis is off, it turns on the host.

fixes openbmc/openbmc#2795

Change-Id: I119a1c95e57c10ccee27be1512a1fc38cde307fa
Signed-off-by: Iftekharul Islam <iffy.ryan@ibm.com>
Signed-off-by: CamVan Nguyen <ctnguyen@us.ibm.com>
diff --git a/app/common/directives/app-header.js b/app/common/directives/app-header.js
index 1ba55ba..2a34381 100644
--- a/app/common/directives/app-header.js
+++ b/app/common/directives/app-header.js
@@ -24,7 +24,7 @@
                         if(!userModel.isLoggedIn()){
                             return;
                         }
-                        APIUtils.getHostState(function(status){
+                        APIUtils.getHostState().then(function(status){
                             if(status == 'xyz.openbmc_project.State.Host.HostState.Off'){
                                 dataService.setPowerOffState();
                             }else if(status == 'xyz.openbmc_project.State.Host.HostState.Running'){
@@ -32,6 +32,8 @@
                             }else{
                                 dataService.setBootingState();
                             }
+                        }, function(error){
+                            dataService.activateErrorModal();
                         });
                     }