Add: "N available" copy to the dispatcher side.#383
Open
Conversation
mveytsman
reviewed
Jun 17, 2024
Comment on lines
+39
to
+55
| @broadcasted_infos [ | ||
| :task_created, | ||
| :task_deleted, | ||
| :task_updated, | ||
| :campaign_rider_created, | ||
| :campaign_rider_deleted | ||
| ] | ||
|
|
||
| @impl Phoenix.LiveView | ||
| def handle_info({event, entity}, socket) when event in @broadcasted_infos do | ||
| if entity_in_campaigns?(socket.assigns.campaigns, entity.campaign_id) do | ||
| {:noreply, refetch_and_assign_data(socket)} | ||
| else | ||
| {:noreply, socket} | ||
| end | ||
| end | ||
|
|
Member
There was a problem hiding this comment.
Thanks for adding this!
two feedbacks:
- I think this should go after the handle_events
- It needs a
@impl Phoenix.LiveView
@doc "silently ignore other kinds of messages"
def handle_info(_, socket), do: {:noreply, socket}
after it to silently ignore messages we don't care about (or else the LV crashes :()
mveytsman
requested changes
Jun 17, 2024
Member
mveytsman
left a comment
There was a problem hiding this comment.
Looks good except small bit of feedback!
Contributor
Author
|
Ready for re-review @mveytsman ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Up for discussion: adding clarification copy about remaining slots to sign up for on the dispatcher side. Originally suggested up by @chadmohr in this slack thread.
Screenshot
CleanShot.2024-06-06.at.19.10.31.mp4
Checklist before requesting a review
about this update in the description above.