Skip to content

Commit

Permalink
Merge pull request #1241 from internetee/webpush-offer-nil-issue
Browse files Browse the repository at this point in the history
prevent offer nil issue in webpush
  • Loading branch information
vohmar authored Apr 18, 2024
2 parents fab50df + 169cb79 commit a89ebb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ yarn-debug.log*
/public/assets/builds
public/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 a89ebb6

Please sign in to comment.