Skip to content

Commit

Permalink
prevent offer nil issue in webpush
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Apr 17, 2024
1 parent dfb6bae commit 33b3653
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ yarn-debug.log*
/public/assets/
/public/assets/builds
public/assets/builds/*
app/assets/builds/*
app/assets/builds/*

.DS_Store
3 changes: 2 additions & 1 deletion app/controllers/concerns/offer_notifable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ def send_outbided_notification(auction:, offer:, flash:)
participant_id = last_higher_bidder(auction)
participant = User.find(participant_id)

OfferNotification.with(offer: offer).deliver_later(participant)
OfferNotification.with(offer: offer).deliver_later(participant) if offer.present?

flash[:notice] = "websocket_domain_name, #{auction.domain_name}"
broadcast_outbid_to_notifications(participant: participant, flash: flash)
end
Expand Down

0 comments on commit 33b3653

Please sign in to comment.