Skip to content

Commit

Permalink
Small notification update (forem#1169)
Browse files Browse the repository at this point in the history
* Small notification update

* Rescue errors in notifications
  • Loading branch information
benhalpern authored Nov 21, 2018
1 parent 1e2749b commit 86c6030
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/articles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
border: 0px;
display:inline-block;
width: 27%;
padding: 6px 0px;
padding: 9px 0px;
text-align:left;
border-radius: 100px;
color: $black;
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/notifications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def index
order("notified_at DESC").limit(55).to_a)
elsif params[:filter].to_s.downcase == "comments"
@notifications = NotificationDecorator.
decorate_collection(Notification.where(user_id: current_user.id, notifiable_type: "Comment").
decorate_collection(Notification.where(user_id: current_user.id, notifiable_type: "Comment", action: nil). # Nil action means not reaction in this context
order("notified_at DESC").limit(55).to_a)
else
@notifications = NotificationDecorator.
Expand Down
2 changes: 2 additions & 0 deletions app/views/notifications/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
<div class="single-article single-article-small-pic <%= "unseen" unless notification.read? %>">
<%= render "#{notification.notifiable_type.downcase}", notification: notification %>
</div>
<% rescue => e %>
<% logger.error("Notifification error - #{e.message} - #{notification.id}") %>
<% end %>
<% else %>
<div class="content notification-content comment-content">
Expand Down

0 comments on commit 86c6030

Please sign in to comment.