summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-06-28 06:44:02 +0100
committerSaturnino Abril <saturnino.abril@gmail.com>2017-06-28 13:44:02 +0800
commit99fc4b0988e941242732feff428468c6df69fe50 (patch)
treea0826c8e0b7a2aa6348628da479537c162a6d492 /webapp/utils
parent155c6600aa2f7e9e23aa4117326fbbd5fd441da3 (diff)
downloadchat-99fc4b0988e941242732feff428468c6df69fe50.tar.gz
chat-99fc4b0988e941242732feff428468c6df69fe50.tar.bz2
chat-99fc4b0988e941242732feff428468c6df69fe50.zip
PLT-6900: Hide DotMenu container when DotMenu empty. (#6770)
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/post_utils.jsx20
1 files changed, 20 insertions, 0 deletions
diff --git a/webapp/utils/post_utils.jsx b/webapp/utils/post_utils.jsx
index 991c8fbec..a71aeef31 100644
--- a/webapp/utils/post_utils.jsx
+++ b/webapp/utils/post_utils.jsx
@@ -82,3 +82,23 @@ export function canEditPost(post, editDisableAction) {
}
return canEdit;
}
+
+export function shouldShowDotMenu(post) {
+ if (Utils.isMobile()) {
+ return true;
+ }
+
+ if (!isSystemMessage(post)) {
+ return true;
+ }
+
+ if (canDeletePost(post)) {
+ return true;
+ }
+
+ if (canEditPost(post)) {
+ return true;
+ }
+
+ return false;
+}