Skip to content

Commit

Permalink
Fixed some issues with admin notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
distich committed Nov 18, 2024
1 parent 7051d38 commit d22266d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/controllers/notifications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ def show
conversation = notification.to_notification.conversation
if conversation.present? && conversation.id.present?
Rails.logger.info "Redirecting to conversation with ID: #{conversation.id}"
redirect_to conversation_path(conversation.id, locale: I18n.locale)
redirect_to conversation_path(conversation, locale: I18n.locale)
else
Rails.logger.error "Missing conversation or conversation ID. Notification ID: #{notification.id}, Notification Type: #{notification.to_notification.class.name}"
redirect_to notifications_path(locale: I18n.locale), alert: t(".missing_conversation")
end
elsif notification.to_notification.respond_to?(:conversation_url)
redirect_to notification.to_notification.conversation_url
elsif notification.to_notification.respond_to?(:url)
redirect_to notification.to_notification.url
else
redirect_to notifications_path(locale: I18n.locale), notice: t(".notice")
end
Expand Down
2 changes: 1 addition & 1 deletion app/notifications/admin/new_conversation_notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def email_subject
end

def url
conversation_url(conversation)
conversation_url(conversation, locale: I18n.locale)
end

def conversation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def plan
end

def url
admin_business_conversations_url(business)
admin_business_conversations_url(business, locale: I18n.locale)
end

def business
Expand Down
2 changes: 1 addition & 1 deletion app/notifications/new_message_notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def ios_subject
end

def url
conversation_url(conversation)
conversation_url(conversation, locale: I18n.locale)
end

def message
Expand Down

0 comments on commit d22266d

Please sign in to comment.