added net connection status

This commit is contained in:
Komek Hayytnazarov 2022-09-30 16:30:49 +05:00
parent d5f329fb5f
commit eb1c70d56c
1 changed files with 8 additions and 0 deletions

View File

@ -8,6 +8,14 @@ export const fetchWrapper = {
};
function request(method) {
console.log("INT STATUS: ", navigator.onLine);
if (!navigator.onLine) {
const alertStore = useAlertStore();
alertStore.error("Please check your internet connection");
return Promise.reject("connection error");
}
return (url, body, isFormData = false) => {
console.log("url: " + url, "body: ", body, "isFormData: ", isFormData);
const requestOptions = {