Skip to content

Commit

Permalink
Fix ajax session of power off all request #100
Browse files Browse the repository at this point in the history
  • Loading branch information
haimkastner committed Jan 21, 2020
1 parent 5c93b7a commit 6827bc3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/src/light-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,15 @@ let powerAllOff = () => {
setViewPowerSync();

const xmlhttp = new XMLHttpRequest();
xmlhttp.withCredentials = true;
xmlhttp.onload = () => {
if (xmlhttp.readyState === 4 && xmlhttp.status == 204) {
isSync = false;
petchMinions();
return;
}

setViewPowerOn();
alert('POWER OFF FAIL');
};
xmlhttp.open('PUT', `${environments.API_URL}/minions/power-off`, true);
Expand Down

0 comments on commit 6827bc3

Please sign in to comment.