Browse Source

implement default bang button

main
familyfriendlymikey 2 years ago
parent
commit
fa27ab79ef
  1. 12
      app/client.imba

12
app/client.imba

@ -312,10 +312,13 @@ tag app
return err "pinning link", e return err "pinning link", e
await reload_db! await reload_db!
imba.commit! imba.commit!
p link
def handle_click_make_default_bang link def handle_click_make_default_bang link
p link if link.is_bang isnt true
return err "setting default bang", "Link is not a bang."
config.default_bang = link
save_config!
window.alert "{link.display_name} is now the default bang"
def handle_shift_backspace def handle_shift_backspace
return unless state.scored_links.length > 0 return unless state.scored_links.length > 0
@ -594,7 +597,10 @@ tag app
<.link-right> <.link-right>
<.link-buttons> <.link-buttons>
<.link-button@click.prevent.stop=handle_click_edit(link)> "E" <.link-button@click.prevent.stop=handle_click_edit(link)> "E"
<.link-button@click.prevent.stop=handle_click_make_default_bang(link)> "B" <.link-button
@click.if(link.is_bang).prevent.stop=handle_click_make_default_bang(link)
[c:purple3/20]=!link.is_bang
> "B"
<.link-button@click.prevent.stop=handle_click_delete(link)> "D" <.link-button@click.prevent.stop=handle_click_delete(link)> "D"
<.link-button <.link-button
@click.prevent.stop=handle_click_pin(link) @click.prevent.stop=handle_click_pin(link)

Loading…
Cancel
Save