Skip to content

Commit 9e55122

Browse files
authored
ts pmo, add back delay system
1 parent 379c8b3 commit 9e55122

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/addons/addons/block-count/blockcount.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ export default async function ({ addon, console, msg }) {
4141
}
4242

4343
const updateText = () => {
44-
const counts = getBlockCount();
45-
if (counts[0] === counts[1]) counterElement.innerText = counts[1] + (counts[1] > 1 ? " blocks" : " block");
46-
else counterElement.innerText = `${counts[0]} / ${counts[1]} blocks`;
44+
const count = getBlockCount();
45+
counterElement.innerText = count + (count > 1 ? " blocks" : " block");
4746
};
4847

4948
const addLiveBlockCount = () => {
@@ -58,7 +57,7 @@ export default async function ({ addon, console, msg }) {
5857
const now = Date.now();
5958
if (
6059
counterElement &&
61-
now > lastUpdateTime && // dont update the count multiple times in a second
60+
now > lastUpdateTime + 150 && // dont update the count multiple times in a second
6261
(event.type === events.DELETE || event.type === events.CREATE)
6362
) {
6463
lastUpdateTime = now;

0 commit comments

Comments
 (0)