Add context menu option to toggle Sort by Name

This commit is contained in:
David Ernst
2019-05-04 22:39:27 -07:00
parent 2dc2953831
commit 2466b2e0a6
2 changed files with 18 additions and 3 deletions

View File

@@ -279,6 +279,16 @@ module.exports = class TorrentListController {
enabled: torrentSummary.torrentFileName != null
}))
menu.append(new electron.remote.MenuItem({
type: 'separator'
}))
const sortedByName = this.state.saved.prefs.sortByName
menu.append(new electron.remote.MenuItem({
label: `${sortedByName ? '✓ ' : ''}Sort by Name`,
click: () => dispatch('updatePreferences', 'sortByName', !sortedByName)
}))
menu.popup(electron.remote.getCurrentWindow())
}