From 32c6a3c57f2d00bdd4becaef68c608a74fbe8dac Mon Sep 17 00:00:00 2001
From: ubermanu <e.vodor@gmail.com>
Date: Thu, 18 Mar 2021 13:39:46 +0100
Subject: [PATCH] bugfix: make the drawer a singleton

---
 src/plugins/sib-reactions.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/plugins/sib-reactions.js b/src/plugins/sib-reactions.js
index a2c2092..8ba3be9 100644
--- a/src/plugins/sib-reactions.js
+++ b/src/plugins/sib-reactions.js
@@ -218,6 +218,12 @@ converse.plugins.add('sib-reactions', {
        */
       openEmojiPicker(ev) {
         ev.preventDefault();
+
+        // Avoid an error when opening a new picker
+        if (this.querySelector('emoji-picker')) {
+          return;
+        }
+
         const picker = new Picker();
 
         picker.addEventListener('emoji-click', e => {
-- 
GitLab