pis #2

Merged
fred.boniface merged 76 commits from pis into main 2023-05-06 21:53:45 +01:00
Showing only changes of commit 90734cd098 - Show all commits

View File

@ -150,27 +150,6 @@ async function getApi(path,auth = false) {
} }
} }
async function getApi(path,auth = false) {
let apiVer = 'v1'
let url = `https://${window.location.origin}/api/${apiVer}/${path}`
log(`getApi: Fetching from endpoint: ${url}, Auth=${auth}`)
try {
var resp = await fetch(url)
if (resp != 200) {
return false
}
if (!resp.ok) {
return false
}
if (resp.json() === "[]") {
return 'empty'
}
return resp.json();
} catch(err) {
return false
}
}
async function vibe(type) { async function vibe(type) {
let canVibrate = "vibrate" in navigator || "mozVibrate" in navigator let canVibrate = "vibrate" in navigator || "mozVibrate" in navigator
if (canVibrate && !("vibrate" in navigator)){ if (canVibrate && !("vibrate" in navigator)){