From 528ba49dee28d4c801522c8cb12b538924e4b3e0 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sun, 28 Oct 2018 12:52:20 +0900 Subject: [PATCH] Handle NaN case for notification count --- scripts/NotificationManager.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/NotificationManager.ts b/scripts/NotificationManager.ts index d2eca193..ae7ba85e 100644 --- a/scripts/NotificationManager.ts +++ b/scripts/NotificationManager.ts @@ -18,6 +18,10 @@ export default class NotificationManager { let body = await response.text() this.unseen = parseInt(body) + if(isNaN(this.unseen)) { + this.unseen = 0 + } + if(this.unseen > 99) { this.unseen = 99 }