From bc128e1a8d6dd1a83f5163168bd96c0154dae671 Mon Sep 17 00:00:00 2001 From: Miranquil Date: Fri, 22 Jan 2021 23:59:16 +0800 Subject: [PATCH] fix NaN and Infinity displayed in short page --- source/js/utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/js/utils.js b/source/js/utils.js index 37bdcd7..3f5cdbd 100644 --- a/source/js/utils.js +++ b/source/js/utils.js @@ -36,6 +36,8 @@ KEEP.initUtils = () => { const percent_dom = this.back2TopButton_dom.querySelector('.percent'); if (percent === '0') { this.back2TopButton_dom.style.display = 'none'; + } if (percent !== percent || !isFinite(percent)) { + this.back2TopButton_dom.style.display = 'none'; } else { this.back2TopButton_dom.style.display = 'flex'; percent_dom.innerHTML = percent;