diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-05-27 16:01:28 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-27 16:01:28 -0400 |
commit | 6399a94ce221be3d15e7132654c28cd953075ec6 (patch) | |
tree | 4b1927fdd8374e8bd3cb809ecb720f2689043358 /webapp/utils/utils.jsx | |
parent | ca9f348be6bf62fc888df9a710c9af155872528e (diff) | |
download | chat-6399a94ce221be3d15e7132654c28cd953075ec6.tar.gz chat-6399a94ce221be3d15e7132654c28cd953075ec6.tar.bz2 chat-6399a94ce221be3d15e7132654c28cd953075ec6.zip |
PLT-2672 Refactored posts view with caching (#3054)
* Refactored posts view to use view controller design
* Add post view caching
* Required updates after rebase
* Fixed bug where current channel not set yet was causing breakage
Diffstat (limited to 'webapp/utils/utils.jsx')
-rw-r--r-- | webapp/utils/utils.jsx | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx index 978f231df..9b0e370bf 100644 --- a/webapp/utils/utils.jsx +++ b/webapp/utils/utils.jsx @@ -909,14 +909,7 @@ export function isValidUsername(name) { } export function isMobile() { - return window.innerWidth <= 768; -} - -export function isComment(post) { - if ('root_id' in post) { - return post.root_id !== '' && post.root_id != null; - } - return false; + return window.innerWidth <= Constants.MOBILE_SCREEN_WIDTH; } export function getDirectTeammate(channelId) { @@ -1315,10 +1308,6 @@ export function isFeatureEnabled(feature) { return PreferenceStore.getBool(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, Constants.FeatureTogglePrefix + feature.label); } -export function isSystemMessage(post) { - return post.type && (post.type.lastIndexOf(Constants.SYSTEM_MESSAGE_PREFIX) === 0); -} - export function fillArray(value, length) { const arr = []; @@ -1379,18 +1368,3 @@ export function localizeMessage(id, defaultMessage) { export function mod(a, b) { return ((a % b) + b) % b; } - -export function getProfilePicSrcForPost(post, timestamp) { - let src = Client.getUsersRoute() + '/' + post.user_id + '/image?time=' + timestamp; - if (post.props && post.props.from_webhook && global.window.mm_config.EnablePostIconOverride === 'true') { - if (post.props.override_icon_url) { - src = post.props.override_icon_url; - } else { - src = Constants.DEFAULT_WEBHOOK_LOGO; - } - } else if (isSystemMessage(post)) { - src = Constants.SYSTEM_MESSAGE_PROFILE_IMAGE; - } - - return src; -} |