From ddf279528445a3a68045671e84beef4f647612fd Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 10 Aug 2017 16:20:56 -0400 Subject: [PATCH] removing persona-specific logic from chats from Persona --- lib/client/chats.js | 20 -------------------- lib/persona.js | 6 +----- 2 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 lib/client/chats.js diff --git a/lib/client/chats.js b/lib/client/chats.js deleted file mode 100644 index a907b07..0000000 --- a/lib/client/chats.js +++ /dev/null @@ -1,20 +0,0 @@ -define('persona/chats', ['components', 'forum/chats'], function(components, coreChats) { - var Chats = {}; - - Chats.init = function() { - var env = utils.findBootstrapEnvironment(); - if (ajaxify.data.hasOwnProperty('roomId') && (env === 'sm' || env === 'xs')) { - app.openChat(ajaxify.data.roomId, ajaxify.data.uid); - } - components.get('chat/recent').on('click', '[component="chat/recent/room"]', function(e) { - env = utils.findBootstrapEnvironment(); - if (env === 'xs' || env === 'sm') { - app.openChat($(this).attr('data-roomid')); - } else { - coreChats.switchChat($(this).attr('data-roomid')); - } - }); - }; - - return Chats; -}); \ No newline at end of file diff --git a/lib/persona.js b/lib/persona.js index 532603d..fc14723 100644 --- a/lib/persona.js +++ b/lib/persona.js @@ -26,11 +26,7 @@ $(document).ready(function() { NProgress.done(); setupHoverCards(); - if (data.url && data.url.match('^user/.+/chats')) { - require(['persona/chats'], function(chats) { - chats.init(); - }); - } else if (data.url && data.url.match('user/')) { + if (data.url && data.url.match('user/')) { setupFavouriteButtonOnProfile(); } });