FIX: Duplicate link shouldn't happen on edit

This commit is contained in:
Robin Ward
2016-06-08 17:20:32 -04:00
parent 3e3538d603
commit 9a81115c1c
4 changed files with 18 additions and 11 deletions

View File

@ -8,7 +8,7 @@ class ComposerMessagesController < ApplicationController
finder = ComposerMessagesFinder.new(current_user, params.slice(:composer_action, :topic_id, :post_id))
json = { composer_messages: [finder.find].compact }
if params[:composer_action] == "reply" && params[:topic_id].present?
if params[:topic_id].present?
topic = Topic.where(id: params[:topic_id]).first
if guardian.can_see?(topic)
json[:extras] = {duplicate_lookup: TopicLink.duplicate_lookup(topic)}