feature (notification): inform user of anything happenning

This commit is contained in:
Mickael KERJEAN
2018-04-09 15:43:22 +10:00
parent 24592be54b
commit c25eb03540
8 changed files with 222 additions and 94 deletions

View File

@ -23,9 +23,9 @@ export function http_get(url, type = 'json'){
}
}else{
if(navigator.onLine === false){
err({status: xhr.status, code: "CONNECTION_LOST", message: 'Connection Lost'});
err({status: xhr.status, code: "CONNECTION_LOST", message: 'Ooups! Looks like your internet has gone away'});
}else{
err({status: xhr.status, message: xhr.responseText || 'Oups something went wrong'});
err({status: xhr.status, message: xhr.responseText || 'Oups! Something went wrong'});
}
}
}
@ -35,7 +35,6 @@ export function http_get(url, type = 'json'){
});
}
export function http_post(url, data, type = 'json'){
return new Promise((done, err) => {
var xhr = new XMLHttpRequest();