From 1fd60b48b0292de51a42ecb13a4a9ee4bd7243be Mon Sep 17 00:00:00 2001 From: familyfriendlymikey Date: Thu, 1 Sep 2022 14:27:22 -0400 Subject: [PATCH] simplify math code --- app/client.imba | 3 --- app/components/app-links.imba | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/client.imba b/app/client.imba index 54686d8..e292e91 100644 --- a/app/client.imba +++ b/app/client.imba @@ -231,9 +231,6 @@ tag app viewing_community_links = no sort_links! - def handle_click_add - handle_add! - def handle_input selection_index = 0 sort_links! diff --git a/app/components/app-links.imba b/app/components/app-links.imba index a4f3333..23cad9f 100644 --- a/app/components/app-links.imba +++ b/app/components/app-links.imba @@ -22,6 +22,7 @@ tag app-links try let result = Number(eval_math state.query) throw _ if isNaN result + throw _ if result.toString! is state.query.trim! result catch no @@ -122,8 +123,7 @@ tag app-links disabled=state.loading > - let m = math_result - if m isnt no and m.toString! isnt state.query.trim! + if (let m = math_result) isnt no <.side.right[c:blue3 fs:20px ml:10px w:unset] @click=handle_click_copy(m) > "= {Math.round(m * 100)/100}"