gdpelican / retort

A reactions plugin for Discourse
MIT License
58 stars 38 forks source link

Icon popup not appearing #23

Closed shadowbrush closed 7 years ago

shadowbrush commented 7 years ago

Hi,

I just installed this plugin for an up-to-date Discourse installation. It was working nicely until I tried to limit the icon selection. I tried to set it to this:

slight_smile|smile|sunglasses|dizzyface|stuc_out_tongue|dizzy_face|upside_down|+1|-1|clap|wave|ok_hand|raised_hand|heart|rage

There's probably an invalid icon in the list. After saving this setting, the icon popup would not appear anymore. Neither when clicking on the retort button, nor on the emoji button in the post editor. The page would be dimmed, but no popup shown. Resetting the plugin's settings to default didn't help. Neither did disabling the plug-in, nor rebuilding the container.

The inspector reports this error: Uncaught TypeError: Cannot read property 'icons' of undefined, which apparently happens in a render method (last line in the (uglified code below):

function render(page, offset, options) {
  keyValueStore.set({ key: "emojiPage", value: page });
  keyValueStore.set({ key: "emojiOffset", value: offset });

  var toolbarItems = toolbar(page);
  var rows = [];
  var row = [];
  var icons = groups[page].icons;

Any idea now to fix it?

gdpelican commented 7 years ago

Hrm, I'm not able to reproduce this; adding the aforementioned value into the custom retort field yields this for me:

screen shot 2017-01-15 at 12 57 36 am

..which is about what I'd expect. Are you able to tell what the value of 'groups' and 'page' are there?

shadowbrush commented 7 years ago

@gdpelican Thanks for the fast response! It turned out to be client-side caching. After resetting it, the popup appears with the correct icons. Oh, and thank you for providing this plug-in!