       cssClass       : 'GenericButton hidden set-default'
       callback       : =>
         appManager.tell 'Stacks', 'exitFullscreen'  unless @getOption 'skipFullscreen'
-        createShareModal (needShare, modal) =>
-          @once 'Completed', =>
-            if needShare
-              @shareCredentials -> modal.destroy()
-            else
-              modal.destroy()
-          @handleSetDefaultTemplate()
+        @handleSetDefaultTemplate()
 
     @buttons.addSubView @generateStackButton = new kd.ButtonView
       title          : 'INITIALIZE'

        if canEditGroup
          # admin is editing a team stack
          if stackTemplate.isDefault
            @handleSetDefaultTemplate completed = no
            @outputView.addAndWarn '''
              Your stack script has been successfully saved and all your new team
              members now will see this stack by default. Existing users
              of the previous default-stack will be notified that default-stack has
              changed.

              You can now close this window or continue working with your stack.
            '''
          # admin is editing a private stack
          else
            @afterProcessTemplate 'maketeamdefault'

      @emit 'Reload'


  handleSetDefaultTemplate: (callback = kd.noop) ->

    createShareModal (needShare, modal) =>
      @_handleSetDefaultTemplate (stackTemplate) =>

        if needShare
        then @shareCredentials -> modal.destroy()
        else modal.destroy()

        callback stackTemplate


  _handleSetDefaultTemplate: (callback = kd.noop) ->

    { stackTemplate }    = @getData()
    { groupsController, reactor } = kd.singletons
