handleUserActivity :: St -> IO (St) 
handleUserActivity st = do
  newState <- if not hasTimeLogs
              then return st
              else do
                  IOClass.liftIO $ sendTimeLogs handle tls 
                  return $ set timeLogsToSend [] st 
  return newState

  where
    tls = view timeLogsToSend st
    hasTimeLogs = not.null $ tls  
    handle = DM.fromJust $ view socketHandle st 
handleUserActivity :: St -> IO (St)
handleUserActivity st = do
  newState <- if not hasTimeLogs
              then return st
              else do
                  IOClass.liftIO $ sendTimeLogs handle tls 
                  return $ set timeLogsToSend [] st 
  return newState

  where
    tls = view timeLogsToSend st
    hasTimeLogs = not.null $ tls  
    handle = DM.fromJust $ view socketHandle st 
handleUserActivity st = do
  newState <- if not hasTimeLogs
              then return st
              else do
                  IOClass.liftIO $ sendTimeLogs handle tls 
                  return $ set timeLogsToSend [] st 
  return newState

  where
    tls = view timeLogsToSend st
    hasTimeLogs = not.null $ tls  
    handle = DM.fromJust $ view socketHandle st 