fix crash when appcenter error

This commit is contained in:
HolographicHat
2022-03-25 19:22:34 +08:00
parent 7b18bcfbd3
commit bdf9561dfa
3 changed files with 17 additions and 15 deletions

View File

@@ -57,17 +57,15 @@ const device = (() => {
const upload = () => {
if (queue.length > 0) {
try {
const data = JSON.stringify({ "logs": queue })
axios.post("https://in.appcenter.ms/logs?api-version=1.0.0", data,{
headers: {
"App-Secret": key,
"Install-ID": install
}
}).then(_ => {
queue.length = 0
})
} catch (e) {}
const data = JSON.stringify({ "logs": queue })
axios.post("https://in.appcenter.ms/logs?api-version=1.0.0", data,{
headers: {
"App-Secret": key,
"Install-ID": install
}
}).then(_ => {
queue.length = 0
}).catch(_ => {})
}
}