   @defaultProps =
     className : 'Approved'
 
+  constructor: (props) ->
+
+    super
+
+    @state = {
+      isModalActive : true
+    }
 
   onLeaveClicked: ->
 
+    console.log('@state ', @state)
+    @setState {isModalActive: false}
     modal = new ContentModal
       title   : 'Are you sure?'
       content : "<p class='text-center'>This will remove the shared VM from your sidebar. You won't be able to access it unless you are invited again.</p>"
       cssClass : 'content-modal'
+      cancel : =>
+        @setState {isModalActive: true}
+
       buttons :
         No         :
           title    : 'Cancel'
           cssClass : 'solid cancel medium'
-          callback : -> modal.destroy()
+          callback : =>
+            @setState {isModalActive: true}
+            modal.destroy()
         Yes        :
           title    : 'Yes'
           cssClass : 'solid medium'

          callback : =>
            actions.rejectInvitation @props.machine
            Tracker.track Tracker.VM_LEFT_SHARED
            modal.destroy()



  render: ->


    then 'LEAVE SESSION'
    else 'LEAVE SHARED VM'

    if @state.isModalActive
      <SidebarWidget {...@props}>
      <p className='SidebarWidget-Title'>Shared with you by</p>
        <InvitationWidgetUserPart
          owner={@props.machine.get 'owner'}
        />
      <button className='kdbutton GenericButton' onClick={@bound 'onLeaveClicked'}>
        <span className='button-title'>{buttonText}</span>
      </button>
      </SidebarWidget>
    else
      null