fix deep comment reply hang

fixes #594
This commit is contained in:
justcool393 2023-07-27 17:07:28 -05:00 committed by Ben Rog-Wilhelm
parent 4a348b9558
commit a5e658ea42

View file

@ -27,29 +27,20 @@
<div class="comment-body">
<div id="comment-{{c.id}}-only" class="comment-{{c.id}}-only"></div>
{% if render_replies %}
{% if level <= RENDER_DEPTH_LIMIT - 1 %}
<div id="replies-of-{{c.id}}" class="">
{% set standalone=False %}
<div id="replies-of-{{c.id}}" class="{% if replies and is_notification_page %}d-none d-md-block{% endif %}">
{% if level <= RENDER_DEPTH_LIMIT - 1 %}
{% set standalone=false %}
{% for reply in replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
{% endif %}
</div>
{% if replies and level >= RENDER_DEPTH_LIMIT -%}
<div id="morecomment-{{c.id}}" class="{% if is_notification_page %}d-md-none {% endif %}mt-2 more-comments">
{% if not is_notification_page %}<button id="btn-{{c.id}}" class="d-none d-md-block btn btn-primary" onclick="morecomments('{{c.id}}')">More comments ({{c.descendant_count}})</button>{% endif %}
<a {% if not is_notification_page %}class="d-md-none" {% endif %}href="{{c.morecomments}}">More comments <i class="fas fa-long-arrow-right ml-1"></i></a>
</div>
{% elif replies and is_notification_page %}
<div id="replies-of-{{c.id}}" class="d-none d-md-block">
{% set standalone=False %}
{% for reply in replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>
<div id="morecomment-{{c.id}}" class="d-md-none mt-2 more-comments">
<a href="{{c.morecomments}}">More comments <i class="fas fa-long-arrow-right ml-1"></i></a>
</div>
{% elif replies %}
<div id="morecomment-{{c.id}}" class="mt-2 more-comments">
<button id="btn-{{c.id}}" class="d-none d-md-block btn btn-primary" onclick="morecomments('{{c.id}}')">More comments ({{c.descendant_count}})</button>
<a class="d-md-none" href="{{c.morecomments}}">More comments <i class="fas fa-long-arrow-right ml-1"></i></a>
</div>
{% endif %}
{%- endif %}
{% endif %}
</div>
</div>