mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
Fixes the link count on the sidebar by only counting unique titles.
This commit is contained in:
parent
25dc5043e3
commit
129cc92ec9
1 changed files with 4 additions and 1 deletions
|
@ -41,7 +41,10 @@ export default createWidget('post-gutter', {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.collapsed) {
|
if (state.collapsed) {
|
||||||
const remaining = links.length - MAX_GUTTER_LINKS;
|
var differentTitles = new Set();
|
||||||
|
links.forEach(function(x) { differentTitles.add(x.title); });
|
||||||
|
const remaining = differentTitles.size - MAX_GUTTER_LINKS;
|
||||||
|
|
||||||
if (remaining > 0) {
|
if (remaining > 0) {
|
||||||
result.push(h('li', h('a.toggle-more', I18n.t('post.more_links', {count: remaining}))));
|
result.push(h('li', h('a.toggle-more', I18n.t('post.more_links', {count: remaining}))));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue