mobile: set api URL and skip isOnline on browser

This commit is contained in:
2024-10-02 17:12:57 +02:00
parent 17e4bea438
commit e89904f6df

View File

@ -3,10 +3,13 @@ File name : database.js
Description : Communicates with the server to ensure that the data is up to date.
*/
const BASE_URL = "http://localhost/";
const BASE_URL = "https://odari.ch/fecharts-api/";
let feData = JSON.parse(localStorage.getItem("feData"));
function isOnline() {
if (window.cordova.platformId == "browser")
return true;
// Check that navigator.connection is not undefined to avoid error
// Necessary when the app run on the browser
const networkState = (navigator.connection) ? navigator.connection.type : null;