Get file name to display in delete modal.

pull/5370/head
ioedeveloper 5 years ago committed by Liana Husikyan
parent 056c72ffb5
commit f69ed6f823
  1. 5
      src/app/files/file-explorer.js

@ -266,8 +266,11 @@ function fileExplorer (localRegistry, files, menuItems) {
} }
actions['Delete'] = () => { actions['Delete'] = () => {
if (self.files.isReadOnly(key)) { return tooltip('cannot delete file. ' + self.files.type + ' is a read only explorer') } if (self.files.isReadOnly(key)) { return tooltip('cannot delete file. ' + self.files.type + ' is a read only explorer') }
const currentPath = self._deps.config.get('currentFile').split('/')
const currentFilename = currentPath[currentPath.length - 1]
modalDialogCustom.confirm( modalDialogCustom.confirm(
'Delete a file', 'Are you sure you want to delete this file?', 'Delete a file', `Are you sure you want to delete ${currentFilename} file?`,
() => { () => {
files.remove(key) files.remove(key)
self.updatePath('browser') self.updatePath('browser')

Loading…
Cancel
Save