 app = angular.module('temba.controllers', ['ui.bootstrap', 'temba.services', 'ngAnimate'])
 
 version = new Date().getTime()
+
+defaultRuleSetType = ->
+  if window.ivr
+    'wait_digit'
+  else if window.ussd
+    'wait_ussd'
+  else
+    'wait_message'
 
 app.controller 'RevisionController', [ '$scope', '$rootScope', '$log', '$timeout', 'Flow', 'Revisions', ($scope, $rootScope, $log, $timeout, Flow, Revisions) ->
 

      return false
    return true

  $rootScope.defaultRuleSetType = ->
    if window.ivr
      rulesetType = 'wait_digit'
    else if window.ussd
      rulesetType = 'wait_ussd'
    else
      rulesetType = 'wait_message'

  $scope.onConnectorDrop = (connection) ->

    $(connection.sourceId).parent().removeClass('reconnecting')

            label: "Response " + (Flow.flow.rule_sets.length + 1)
            operand: "@step.value"
            webhook_action: null,
            ruleset_type: defaultRuleSetType(),
            rules: [
              test:
                test: "true"
