haxzie / instagram-live-streamer

[Unofficial] Broadcast to Instagram Live from your Windows/Mac/Linux
https://getstreamon.com
MIT License
469 stars 79 forks source link

[BUG] Prevent user from sending empty comments in live stream inputs #16

Closed haxzie closed 4 years ago

haxzie commented 4 years ago

Describe the bug The input form in the live stream comments section allows users to send comments even without anything entered inside the textbox. Add a prevention logic to disable form submit if the input/value for comment is empty.

Expected behavior Should prevent the user from allowing to send empty comment text requests,

ChoukseyKhushbu commented 4 years ago

Is this issue already fixed here in /src/Pages/Comments/index.jsx?

 const addComment = async () => {
    console.log("adding comments...");
    const comment = userComment;
    // do not comment, if there is no comment text available
    if (!(comment && comment.length > 0)) return;
    setUserComment('')
    setCommenting(true);
    await client.live.comment(broadcastId, comment);
  }
haxzie commented 4 years ago

@ChoukseyKhushbu Yeah, that should have fixed it.