From 029ff8999a5d3c1613302b805228cd6927b4dddb Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 3 Aug 2026 18:22:04 +0800 Subject: qml: reset component when current state broke via new input --- popups/launcher/components/Calc.qml | 4 ++++ popups/launcher/components/ISmartCalc.qml | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'popups') diff --git a/popups/launcher/components/Calc.qml b/popups/launcher/components/Calc.qml index 6a88c9f..64cde8c 100644 --- a/popups/launcher/components/Calc.qml +++ b/popups/launcher/components/Calc.qml @@ -18,6 +18,10 @@ IComponent { } } + onInputChanged: { + MathCalc.reset_result(); + } + process: function () { MathCalc.query(input); const valid = MathCalc.result && MathCalc.result.length > 0; diff --git a/popups/launcher/components/ISmartCalc.qml b/popups/launcher/components/ISmartCalc.qml index 02b234a..2c31f88 100644 --- a/popups/launcher/components/ISmartCalc.qml +++ b/popups/launcher/components/ISmartCalc.qml @@ -21,8 +21,12 @@ IComponent { } } + onInputChanged: { + SmartCalc.reset_result(); + } + process: function () { - SmartCalc.query(input); + SmartCalc.query(input); const answer = SmartCalc.result; // TODO: use answer property rn its circular dependent since it has to be valid which is the line below const valid = SmartCalc.result && SmartCalc.result.length > 0 && category; -- cgit v1.2.3