Retort - a reaction-style plugin for Discourse

Hi @angus ,
Thank you so much for your reply. I do notice several red lines in the console, please see the picture below from Opera whenever I entered to a post.

It looks like there is something wrong at “import” in my installation. I install Discourse using source code, not Docker, therefore I always put new plugins into discourse/plugins, by which I successfully installed another two plugins. I am not sure if it was the proper way to have retort installed in the same way.

By the way, I did have @popperjs/core installed using npm before, but I don’t know why I encountered this error…

Thank you.

1 Like

That import was added as part of the emoji-picker refactor that led to this plugin being updated a little while ago (see above). It was added to Discourse about a month ago. If you’re getting that error it means you’re running an older version of Discourse. I’m guessing you’re running the stable branch.

This plugin also supports stable, via the .discourse_compatibility file, but if you’re not using Docker, you’ll need to install the plugin using the rake task plugin:pull_compatible_all which will pull the right version of the plugin for stable.

If this is a production environment, and you’re relatively new to Discourse I would strongly recommend you use Docker. It handles a number of aspects of managing a Discourse environment, like pulling the right plugin version for your environment, that could potentially trip you up.

4 Likes

Hi I had emoji restricted. An update awhile ago I had to allow unrestricted emojis for the plugin to work.

1 Like

Thank you so much @angus, you are right I am on stable branch of discourse now. I will run rake task to pull the compatible version of retort. After I obtain domain name, I will go with Docker image for a more convenient way. :grinning:

Update:
I ran rake plugin:pull_compatible_all, yet it seems my stable version of discourse is way too old. So I pull latest version of discourse. Now everything works smoothly :grin:
5

Thank you again for your kind help :smiley:

2 Likes

In the default theme of Discourse, in the mobile view, the reply button is split from the rest of the bottom toolbar icons (like, share, etc) and it pushes the retort icon down and looks really ugly.
I am using this css added to the theme to correct the design. Perhaps you will find it useful for you too

.mobile-view {
    
    .topic-post nav.post-controls .actions button.reply {
        margin: inherit;
        margin-left: 10px;
    }
    
    nav.post-controls .actions {
        text-align: right;
        float: right;
        display: inline-block;
    }
    
    .topic-post nav.post-controls .actions .double-button {
        display: inline-flex;
    }
    
    .post-menu-area {
        margin: 0;
        padding-top: 15px;
    }
}
2 Likes

Awesome, thanks :slightly_smiling_face:

If you need help debugging this or have a clue of what may be the issue please let me know.

1 Like

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:

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.

1 Like

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?

1 Like