Added null checks

This commit is contained in:
2019-04-19 22:12:33 +09:00
parent 912f409688
commit 707233a422
11 changed files with 94 additions and 51 deletions

View File

@ -75,11 +75,16 @@ export default class ServerEvents {
let button = document.getElementById("load-new-activities")
if(!button) {
if(!button || !button.dataset.count) {
return
}
let buttonText = document.getElementById("load-new-activities-text")
if(!buttonText) {
return
}
let newCount = parseInt(button.dataset.count) + 1
button.dataset.count = newCount.toString()
buttonText.textContent = plural(newCount, "new activity")