   getInitialState: ->
     @getStateForFolder @props.client.state.metadata?.parent or null
 
-  componentWillMount: ->
-    @isOpen = @props.dialog.action is 'openFile'
+  isOpen: ->
+    @props.dialog.action is 'openFile'
 
   filenameChanged: (e) ->
     filename = e.target.value

      metadata: metadata

  listLoaded: (list) ->
    @setState
      list: list
      metadata: @findMetadata $.trim(@state.filename), list

  getStateForFolder: (folder) ->
    folder: folder
    metadata: @props.client.state.metadata
    filename: @props.client.state.metadata?.name or ''
    list: []

  fileSelected: (metadata) ->

      @confirm()

  confirmDisabled: ->
    (@state.filename.length is 0) or (@isOpen() and not @state.metadata)

  renderWhenAuthorized: ->
    confirmDisabled = @confirmDisabled()
