about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-10-12 19:03:28 +0200
committerGitHub <noreply@github.com>2022-10-12 19:03:28 +0200
commit2bb443c7d5a28d0d206fc57ad775c2864072e04c (patch)
tree7bf9185eabfc9beaa02e73ed7e22836923a91dab /app/javascript/flavours/glitch/features
parent18f210aff65bb6f4830386d332c721971e20bebe (diff)
Port various forgotten fixes from upstream (#1864)
* [Glitch] Fix crash when failing to load emoji picker

Port bd3420b1398c4c4ab2e2f2850b6dd6eaff0d361b to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Remove duplicate frequently used emojis

Port 98146281e1beaf994710b13ef70f6224e8588cba to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Co-authored-by: Harmon <Harmon758@gmail.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features')
-rw-r--r--app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js2
-rw-r--r--app/javascript/flavours/glitch/features/compose/containers/emoji_picker_dropdown_container.js3
2 files changed, 3 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js b/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js
index 0e49a35c3..546d398a0 100644
--- a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js
+++ b/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js
@@ -345,7 +345,7 @@ class EmojiPickerDropdown extends React.PureComponent {
 
         this.setState({ loading: false });
       }).catch(() => {
-        this.setState({ loading: false });
+        this.setState({ loading: false, active: false });
       });
     }
 
diff --git a/app/javascript/flavours/glitch/features/compose/containers/emoji_picker_dropdown_container.js b/app/javascript/flavours/glitch/features/compose/containers/emoji_picker_dropdown_container.js
index ba85edd87..66d51947a 100644
--- a/app/javascript/flavours/glitch/features/compose/containers/emoji_picker_dropdown_container.js
+++ b/app/javascript/flavours/glitch/features/compose/containers/emoji_picker_dropdown_container.js
@@ -38,7 +38,8 @@ const getFrequentlyUsedEmojis = createSelector([
     .toArray();
 
   if (emojis.length < DEFAULTS.length) {
-    emojis = emojis.concat(DEFAULTS.slice(0, DEFAULTS.length - emojis.length));
+    let uniqueDefaults = DEFAULTS.filter(emoji => !emojis.includes(emoji));
+    emojis = emojis.concat(uniqueDefaults.slice(0, DEFAULTS.length - emojis.length));
   }
 
   return emojis;