Browse Source

simplify math code

main
familyfriendlymikey 2 years ago
parent
commit
1fd60b48b0
  1. 3
      app/client.imba
  2. 4
      app/components/app-links.imba

3
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!

4
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}"

Loading…
Cancel
Save