   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

      filename = $.trim @state.filename
      @state.metadata = @findMetadata filename, @state.list
      if not @state.metadata
        if @isOpen
          @props.client.alert "#{@state.filename} not found"
        else
          @state.metadata = new CloudMetadata

      metadata: metadata

  listLoaded: (list) ->
    @setState list: list

  getStateForFolder: (folder) ->
    metadata = if @isOpen() then @state?.metadata or null else @props.client.state.metadata
    folder: folder
    metadata: metadata
    filename: metadata?.name or ''
    list: []

  fileSelected: (metadata) ->
