Add another message for empty folders

This commit is contained in:
Dmytro Sadovnychyi 2017-11-17 19:08:20 +08:00
parent 912b6b8714
commit e6eec30783
2 changed files with 10 additions and 3 deletions

View file

@ -352,9 +352,15 @@ module.exports = class View {
state.selectedFolders[folderId] = {loading: false, files: files}
this.updateState({selectedFolders: folders})
const dashboard = this.plugin.core.getPlugin('Dashboard')
this.plugin.core.info(dashboard.i18n('folderAdded', {
smart_count: files.length, folder: this.plugin.getItemName(folder)
}))
let message
if (files.length) {
message = dashboard.i18n('folderAdded', {
smart_count: files.length, folder: this.plugin.getItemName(folder)
})
} else {
message = dashboard.i18n('emptyFolderAdded')
}
this.plugin.core.info(message)
}).catch((e) => {
state = this.plugin.core.getState()[this.plugin.stateId]
delete state.selectedFolders[folderId]

View file

@ -52,6 +52,7 @@ module.exports = class DashboardUI extends Plugin {
fileProgress: 'File progress: upload speed and ETA',
numberOfSelectedFiles: 'Number of selected files',
uploadAllNewFiles: 'Upload all new files',
emptyFolderAdded: 'No files were added from empty folder',
folderAdded: {
0: 'Added %{smart_count} file from %{folder}',
1: 'Added %{smart_count} files from %{folder}'