FIX: Always render topic counts (#13563)

A post is rendered multiple times when it is being loaded. Sometimes,
not all information is available and the best link in the Onebox cannot
be found.
This commit is contained in:
Bianca Nenciu 2021-06-30 08:30:16 +03:00 committed by GitHub
parent b8a0e47913
commit e123476329
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,7 +142,8 @@ export default class PostCooked {
const $onebox = $link.closest(".onebox");
if (
$onebox.length === 0 ||
(bestElements[$onebox[0]] && bestElements[$onebox[0]] === $link[0])
!bestElements[$onebox[0]] ||
bestElements[$onebox[0]] === $link[0]
) {
const title = I18n.t("topic_map.clicks", { count: lc.clicks });
$link.append(