pis #1
@ -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) {
 | 
			
		||||
    let canVibrate = "vibrate" in navigator || "mozVibrate" in navigator
 | 
			
		||||
    if (canVibrate && !("vibrate" in navigator)){
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user