fixed toast spam #29
This commit is contained in:
parent
5a9594074e
commit
b7ab487fac
@ -17,9 +17,16 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>
|
along with this program. If not, see <https://www.gnu.org/licenses/>
|
||||||
*/
|
*/
|
||||||
apiOnline = true
|
apiOnline = true
|
||||||
|
lastMessageShown = new Date()
|
||||||
|
everShown = false
|
||||||
async function doPing(){
|
async function doPing(){
|
||||||
out = setTimeout(function(){
|
out = setTimeout(function(){
|
||||||
|
if (everShown && new Date() - lastMessageShown < 90000){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
everShown = true
|
||||||
if (apiOnline){
|
if (apiOnline){
|
||||||
|
lastMessageShown = new Date()
|
||||||
PNotify.notice('Connection lost with API server')
|
PNotify.notice('Connection lost with API server')
|
||||||
}
|
}
|
||||||
apiOnline = false
|
apiOnline = false
|
||||||
|
Loading…
Reference in New Issue
Block a user