Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- method !wire-input() {
- $!input.on-submit.tap: -> $text {
- if $!editing-msg-id.defined {
- # Ignore empty-edit submits — treat as no-op rather than
- # deleting the message's content. Cancel via Esc.
- self!commit-edit($text) if $text.chars > 0;
- } elsif !$!streaming && $text.chars > 0 && self!current-conversation.defined {
- self!send-user-message($text);
- $!input.clear;
- }
- };
- # Esc on the input cancels an in-flight edit (without clearing
- $!input.on-key: 'esc', -> $ {
- self!cancel-edit if $!editing-msg-id.defined;
- }, :description('Cancel message edit');
- }
Advertisement
Add Comment
Please, Sign In to add comment