Small notification update (#1169)

* Small notification update

* Rescue errors in notifications
This commit is contained in:
Ben Halpern 2018-11-20 20:03:55 -05:00 committed by GitHub
parent 1e2749be24
commit 86c60307d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View file

@ -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;

View file

@ -14,7 +14,7 @@ class NotificationsController < ApplicationController
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.

View file

@ -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">