 
       { stackTemplates }       = groupsController.getCurrentGroup()
       stackTemplate.isDefault ?= stackTemplate._id in (stackTemplates or [])
-      templateSetBefore        = stackTemplates?.length
+      hasGroupTemplates        = stackTemplates?.length
 
       stacks = kd.singletons.reactor.evaluateToJS ['StacksStore']
       templateIds = Object.keys(stacks).map (key) -> stacks[key].baseStackId

      # TMS-1919: This needs to be reimplemented, once we have multiple
      # stacktemplates set for a team this will be broken ~ GG


      if hasStack
        setToGroup()

      else if templateSetBefore

        unless stackTemplate.isDefault

          if canEditGroup
            @setAsDefaultButton.show()
            @outputView.add '''
              Your stack script has been successfully saved.

              If you want to auto-provision this template when new users join your team,
              you need to click "Make Team Default" after you save it.

              You can now close the stack editor or continue editing your stack.
            '''
          else
            @reinitButton.show()
            @outputView.add '''
              Your stack script has been successfully saved.
              You can now close the stack editor or continue editing your stack.
            '''

          computeController.checkGroupStacks()

        else
          setToGroup()

      else
        setToGroup 'addAndWarn'



  checkAndBootstrapCredentials: (callback) ->



  handleReinit: ->

    stacks = kd.singletons.reactor.evaluateToJS ['StacksStore']
    { stackTemplate } = @getData()

