nodebb-plugin-composer-default 10.2.34 → 10.2.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-composer-default",
3
- "version": "10.2.34",
3
+ "version": "10.2.36",
4
4
  "description": "Default composer for NodeBB",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -227,7 +227,7 @@ define('composer', [
227
227
  if (data.body) {
228
228
  data.body = '> ' + data.body.replace(/\n/g, '\n> ') + '\n\n';
229
229
  }
230
- var link = '[' + escapedTitle + '](' + config.relative_path + '/post/' + (data.selectedPid || data.toPid) + ')';
230
+ var link = '[' + escapedTitle + '](' + config.relative_path + '/post/' + encodeURIComponent(data.selectedPid || data.toPid) + ')';
231
231
  if (data.uuid === undefined) {
232
232
  if (data.title && (data.selectedPid || data.toPid)) {
233
233
  composer.newReply({
@@ -873,17 +873,11 @@ define('composer', [
873
873
  calls.push(topicThumbs.getByPid(composerObj.pid));
874
874
  }
875
875
  Promise.all(calls).then((thumbs) => {
876
- thumbs = thumbs.reduce((memo, cur) => {
877
- memo = memo.concat(cur);
878
- return memo;
879
- });
880
-
881
- if (thumbs.length) {
882
- const formatEl = postContainer.find('[data-format="thumbs"]');
883
- formatEl.find('.badge')
884
- .text(thumbs.length)
885
- .toggleClass('hidden', !thumbs.length);
886
- }
876
+ const thumbCount = thumbs.flat().length;
877
+ const formatEl = postContainer.find('[data-format="thumbs"]');
878
+ formatEl.find('.badge')
879
+ .text(thumbCount)
880
+ .toggleClass('hidden', !thumbCount);
887
881
  });
888
882
  }
889
883
  };