dont request status null
This commit is contained in:
@@ -62,13 +62,18 @@ function xhr(method, url, cb) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function pollFile () {
|
function pollFile () {
|
||||||
|
if (!key) {
|
||||||
|
keyOutput.textContent = '––––'
|
||||||
|
downloads.style.display = 'none'
|
||||||
|
return
|
||||||
|
}
|
||||||
xhr('GET', '/status/' + key, function (x) {
|
xhr('GET', '/status/' + key, function (x) {
|
||||||
var data
|
var data
|
||||||
try {
|
try {
|
||||||
data = JSON.parse(x.responseText)
|
data = JSON.parse(x.responseText)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
keyOutput.textContent = '––––'
|
|
||||||
key = null
|
key = null
|
||||||
|
keyOutput.textContent = '––––'
|
||||||
downloads.style.display = 'none'
|
downloads.style.display = 'none'
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -99,8 +104,8 @@ function generateKey () {
|
|||||||
if (pollTimer) clearInterval(pollTimer)
|
if (pollTimer) clearInterval(pollTimer)
|
||||||
pollTimer = setInterval(pollFile, 5 * 1000)
|
pollTimer = setInterval(pollFile, 5 * 1000)
|
||||||
} else {
|
} else {
|
||||||
keyOutput.textContent = '––––'
|
|
||||||
key = null
|
key = null
|
||||||
|
keyOutput.textContent = '––––'
|
||||||
downloadlink.href = ''
|
downloadlink.href = ''
|
||||||
}
|
}
|
||||||
keyGenBtn.blur()
|
keyGenBtn.blur()
|
||||||
|
|||||||
Reference in New Issue
Block a user