From fc0fb66d28480700a3d4a748a35ab84c4a0503e6 Mon Sep 17 00:00:00 2001 From: Harshit Bansal Date: Wed, 31 May 2017 13:53:16 +0000 Subject: [PATCH] emoji: Fix realm emoji not appearing in settings page when reopened. When the emoji settings page was reopened after uploading a realm emoji without doing a page refresh, the uploaded emoji disappeared from the emoji list. This was so because the emoji settings page uses `page_params.realm_emoji` to render the emojis which was not updated when a emoji was added. Fixes: #5130. --- static/js/server_events.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/js/server_events.js b/static/js/server_events.js index e32552343f..7600f6f4a5 100644 --- a/static/js/server_events.js +++ b/static/js/server_events.js @@ -133,6 +133,9 @@ function dispatch_normal_event(event) { break; case 'realm_emoji': + // Update `page_params.realm_emoji` so that settings page + // can display it properly when reopened without refresh. + page_params.realm_emoji = event.realm_emoji; emoji.update_emojis(event.realm_emoji); settings_emoji.populate_emoji(event.realm_emoji); break;