PWA offline try to check if offline

This commit is contained in:
Louis DUMONT 2022-03-30 11:35:47 +02:00
parent 16eab3f5d7
commit b14b5443aa
2 changed files with 21 additions and 19 deletions

View File

@ -1,6 +1,10 @@
////////////////////////////////////////////////////
// [ Form Login ]
(function ($) {
if (!window.navigator.onLine){
console.log("offline");
$(".info_message").show();
}
"use strict";
var input = $('.validate-input .input-forms');
$('.validate').on('submit',(function(){
@ -14,7 +18,6 @@
}
if (check){
if (window.navigator.onLine){
$.ajax({
type: 'POST',
url: 'controller/Auth.php',
@ -30,9 +33,7 @@
}, 1000);
}
}});
} else {
$(".info_message").show();
}
}
check = false;
return check;

View File

@ -18,6 +18,7 @@ self.addEventListener('install', (e) => {
'index.php',
'http://ctsstatic.fr/assets/css/index.css',
'http://ctsstatic.fr/assets/js/index.js',
'http://ctsstatic.fr/assets/images/logo_petit.png',
'http://ctsstatic.fr/assets/vendors/jquery/jquery-3.6.0.min.js'
];