fixed toast spam #29

This commit is contained in:
Kevin Froman 2021-01-21 20:23:36 +00:00
parent 5a9594074e
commit b7ab487fac
1 changed files with 8 additions and 1 deletions

View File

@ -17,10 +17,17 @@
along with this program. If not, see <https://www.gnu.org/licenses/>
*/
apiOnline = true
lastMessageShown = new Date()
everShown = false
async function doPing(){
out = setTimeout(function(){
if (everShown && new Date() - lastMessageShown < 90000){
return
}
everShown = true
if (apiOnline){
PNotify.notice('Connection lost with API server')
lastMessageShown = new Date()
PNotify.notice('Connection lost with API server')
}
apiOnline = false
}, 10000)