]> git.codecow.com Git - nano-pow.git/commitdiff
Fix scoring status output.
authorChris Duncan <chris@codecow.com>
Thu, 9 Jul 2026 17:15:16 +0000 (10:15 -0700)
committerChris Duncan <chris@codecow.com>
Fri, 10 Jul 2026 05:21:22 +0000 (22:21 -0700)
test/index.html

index d766f5f00a3147657b5b1144f505a7ce7d26d854..7e3269cee72c9d3adf77fbe21809b3e065828734 100644 (file)
@@ -226,7 +226,9 @@ SPDX-License-Identifier: GPL-3.0-or-later
                        const times = []
                        let hash, result, start, end, check, isValid
                        for (let i = 0; i < size; i++) {
-                               status.textContent = status.textContent.replace(`${(i || 1) - 1}/${size}`, `${i}/${size}`)
+                               const prev = RegExp(`${(i || 1) - 1}/${size}$`)
+                               const next = `${i}/${size}`
+                               status.textContent = status.textContent.replace(prev, next)
                                hash = random()
                                start = performance.now()
                                result = await NanoPow.work_generate(hash, { difficulty, effort, api })