Skip to content

Commit

Permalink
feat(connections): add throttle to the send message button
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-Asuka authored and ysfscream committed Dec 12, 2024
1 parent 73177cd commit 0467742
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/views/connections/ConnectionsDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
:clientConnected="client.connected"
:sendTimeId="sendTimeId"
@foucs="handleMessages"
@handleSend="sendMessage"
@handleSend="throttleSendMessage"
@handleSendTimedMessage="handleCommand('timedMessage')"
@onInsertedCode="handleInsertedCode"
/>
Expand Down Expand Up @@ -1550,6 +1550,8 @@ export default class ConnectionsDetail extends Vue {
afterCallback?.()
}
private throttleSendMessage = _.throttle(this.sendMessage, 500, { leading: true, trailing: false })
/**
* Notifies the user about the successful setup of a timed message.
*/
Expand Down

0 comments on commit 0467742

Please sign in to comment.