From 09514fb9f5dd2bfcdfaad6c9ff324298e983d1ee Mon Sep 17 00:00:00 2001
From: Reed Garmsen <rgarmsen2295@gmail.com>
Date: Fri, 16 Oct 2015 14:21:46 -0700
Subject: Added proper recognition of android devices in the Active Sessions UI

---
 web/react/components/activity_log_modal.jsx | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'web/react/components/activity_log_modal.jsx')

diff --git a/web/react/components/activity_log_modal.jsx b/web/react/components/activity_log_modal.jsx
index 74d6c64e3..2c944913f 100644
--- a/web/react/components/activity_log_modal.jsx
+++ b/web/react/components/activity_log_modal.jsx
@@ -81,6 +81,7 @@ export default class ActivityLogModal extends React.Component {
             const currentSession = this.state.sessions[i];
             const lastAccessTime = new Date(currentSession.last_activity_at);
             const firstAccessTime = new Date(currentSession.create_at);
+            let devicePlatform = currentSession.props.platform;
             let devicePicture = '';
 
             if (currentSession.props.platform === 'Windows') {
@@ -88,7 +89,12 @@ export default class ActivityLogModal extends React.Component {
             } else if (currentSession.props.platform === 'Macintosh' || currentSession.props.platform === 'iPhone') {
                 devicePicture = 'fa fa-apple';
             } else if (currentSession.props.platform === 'Linux') {
-                devicePicture = 'fa fa-linux';
+                if (currentSession.props.os.indexOf('Android') >= 0) {
+                    devicePlatform = 'Android';
+                    devicePicture = 'fa fa-android';
+                } else {
+                    devicePicture = 'fa fa-linux';
+                }
             }
 
             let moreInfo;
@@ -119,7 +125,7 @@ export default class ActivityLogModal extends React.Component {
                     className='activity-log__table'
                 >
                     <div className='activity-log__report'>
-                        <div className='report__platform'><i className={devicePicture} />{currentSession.props.platform}</div>
+                        <div className='report__platform'><i className={devicePicture} />{devicePlatform}</div>
                         <div className='report__info'>
                             <div>{`Last activity: ${lastAccessTime.toDateString()}, ${lastAccessTime.toLocaleTimeString()}`}</div>
                             {moreInfo}
-- 
cgit v1.2.3-1-g7c22

