       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

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

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

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

      (input {type: 'text', value: @state.filename, placeholder: (tr "~FILE_DIALOG.FILENAME"), onChange: @filenameChanged, onKeyDown: @watchForEnter})
      (FileList {provider: @props.provider, folder: @state.folder, selectedFile: @state.metadata, fileSelected: @fileSelected, fileConfirmed: @confirm, list: @state.list, listLoaded: @listLoaded, client: @props.client})
      (div {className: 'buttons'},
        (button {onClick: @confirm, disabled: confirmDisabled, className: if confirmDisabled then 'disabled' else ''}, if @isOpen() then (tr "~FILE_DIALOG.OPEN") else (tr "~FILE_DIALOG.SAVE"))
        if @props.provider.can 'remove'
          (button {onClick: @remove, disabled: removeDisabled, className: if removeDisabled then 'disabled' else ''}, (tr "~FILE_DIALOG.REMOVE"))
        (button {onClick: @cancel}, (tr "~FILE_DIALOG.CANCEL"))
