Remove duplicate - merge error

This commit is contained in:
Fred Boniface 2023-04-28 13:45:52 +01:00
parent 0f22707fc3
commit 90734cd098

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)){