From b8199350258e2b10e2cc0fd949d42e8c5fc01606 Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Thu, 5 Feb 2026 17:43:31 +0700 Subject: [PATCH] fix: Ensure decimal scanning waits for localization parameters to be ready before proceeding. --- static/src/views/decimal_observer.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/static/src/views/decimal_observer.js b/static/src/views/decimal_observer.js index 7e2aa91..c1e8704 100644 --- a/static/src/views/decimal_observer.js +++ b/static/src/views/decimal_observer.js @@ -74,6 +74,19 @@ function processNode(textNode) { function scanDocument() { + try { + // Check if localization is ready by accessing the property + // This will throw if parameters are not ready + const _ = localization.decimalPoint; + } catch (e) { + // If not ready, retry in 200ms + if (timeout) cancelAnimationFrame(timeout); + timeout = setTimeout(() => { + requestAnimationFrame(scanDocument); + }, 200); + return; + } + const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null); const nodesToProcess = []; while (walker.nextNode()) {