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

      @confirm()

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

  renderWhenAuthorized: ->
    confirmDisabled = @confirmDisabled()

  getInitialState: ->
    @getStateForFolder @props.client.state.metadata?.parent or null

  isOpen: ->
    @props.dialog.action is 'openFile'

  filenameChanged: (e) ->
    filename = e.target.value
