Retort - a reaction-style plugin for Discourse

Discourse Version: discourse latest-release +121
Retort: retort 201afe3


I’m still seeing the following errors in google chromes console

Uncaught TypeError: Cannot read property 'map' of undefined
at _retort-972c371c6d8722041975c4d4723d73c31b2cd1f7ab4e5ef40da956eba16f7b7d.js:31
at _application-edf47146272ed83797d8302598e8d2811398547deb797477466306b2b1364d57.js:80552
at Array.map (<anonymous>)
at y (_application-edf47146272ed83797d8302598e8d2811398547deb797477466306b2b1364d57.js:80551)
at t.html (_application-edf47146272ed83797d8302598e8d2811398547deb797477466306b2b1364d57.js:76664)
at t.value (_application-edf47146272ed83797d8302598e8d2811398547deb797477466306b2b1364d57.js:81059)
at t.value (_application-edf47146272ed83797d8302598e8d2811398547deb797477466306b2b1364d57.js:80760)
at s (_vendor-a520d2facd37b23a6fce06beaf5feaa3034f761d5b4f37c89c4cecd3ead14192.js:20537)
at t.exports (_vendor-a520d2facd37b23a6fce06beaf5feaa3034f761d5b4f37c89c4cecd3ead14192.js:20524)
at e (_vendor-a520d2facd37b23a6fce06beaf5feaa3034f761d5b4f37c89c4cecd3ead14192.js:19893)

Seems to be related to this line…

 api.decorateWidget('post-contents:after-cooked', function (helper) {
  var postId = helper.getModel().id;

  var post = _retort.default.postFor(postId);

  if (_retort.default.disabledFor(postId)) {
    return;
  }

  _retort.default.storeWidget(helper);

  return post.retorts.map(function (_ref) {  <<<<(RED X HERE)
    var usernames = _ref.usernames,
        emoji = _ref.emoji;
    return helper.attach('retort-toggle', {
      post: post,
      usernames: usernames,
      emoji: emoji
    });
  });
});
2 Likes

Thanks, I’ll take a look tomorrow.

2 Likes

I’ve handled this (non-breaking) exception :+1:

https://github.com/gdpelican/retort/commit/d04ed98e13fed1939a51fa57dc24fdc0550eb498

4 Likes

Wow, that was quick! Thanks! :slight_smile:

3 Likes

Great, I am hoping to setup this to my community too :grinning:

2 Likes

Any luck with this? Were you able to reproduce the issue? I wonder if we are the only ones with this problem.

2 Likes

It’s somewhat tricky to repro, but I have seen it at least once here:

I’ve made a change that should prevent this from occuring. Could you update and test it?

https://github.com/gdpelican/retort/commit/c172423d59c358239421fc4346b245e2d9e4f811

2 Likes

It does indeed! Many thanks for the fix Angus :clap::smile:

4 Likes

Hi, Is this normal?

1 Like

Would it be possible that reacting would automatically like a post?

Yup. Were you expecting something else?

No, not at this time.

3 Likes

I’m so glad that I discovered this plugin. I have wanted this kind of functionality for a while now.

3 Likes

I’m a member on a group’s forum. To a post, I got more than two reactions of the same type. When I hover over it, it says “[user name 1], [user name 2] and 2 others reacted with [name of emoji]”.

Is there any way to see who those others are?

8 Likes

Please look into this…

https://meta.discourse.org/t/ads-not-visible-at-incognito-mode-after-update/176493/3?u=thebaby5

3 Likes

I don’t know if this was proposed before, but in addition to the reaction emoji’s you might want to specify the alt-label that shows when hovering over the emoji, to better clarify its intent. This because emoji’s can still be interpreted rather randomly, or outright wrongly, based on how they are used in other places.

With labels I might specify:

:thinking: → This inspires me

:blush: → Glad to be of service

:heart: → I adore this idea

:blue_heart: → I am warming to this idea

:-1: → I vote against this idea

:poop: → This is off-topic

4 Likes

This one interests me… :laughing:

2 Likes

I have one user who would receive a lot of this :poop: on their posts.
:slightly_smiling_face:

Since a week or so, the emoji picker is acting up and scrolls to the top of the page and I couldn’t find an existing bug report of this behaviour.

Example over on the Manjaro forum:

As there seem to be multiple people having this problem opening a new bug report.

:sweat_smile:

1 Like

Are you able to reproduce this issue in safe mode? https://forum.manjaro.org/safe-mode

Is your browser up to date? Are you running any plugins/extensions?

4 Likes
  1. Able to reproduce in firefox --safemode
  2. firefox --version
    Mozilla Firefox 85.0
    
  3. NoScript and uBlock Origin plug-ins running when not running in Firefox safe mode

:thinking:

1 Like