Skip to content

Commit

Permalink
馃悰 fix for group selection broken by the code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkulman committed Dec 16, 2018
1 parent 63030d5 commit 0590025
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions LocalizationEditor/Providers/LocalizationsDataSource.swift
Expand Up @@ -55,13 +55,14 @@ class LocalizationsDataSource: NSObject, NSTableViewDataSource {
}

/**
Gets available languges for given group
Selects given group and gets available languages
- Parameter group: group name
- Returns: array of languages
*/
func getLanguages(for group: String) -> [String] {
func selectGroupAndGetLanguages(for group: String) -> [String] {
let group = localizationGroups.first(where: { $0.name == group })!
selectedLocalizationGroup = group
return getLanguages(for: group)
}

Expand Down
2 changes: 1 addition & 1 deletion LocalizationEditor/UI/ViewController.swift
Expand Up @@ -93,7 +93,7 @@ class ViewController: NSViewController {

@IBAction @objc private func selectAction(sender: NSMenuItem) {
let groupName = sender.title
let languages = dataSource.getLanguages(for: groupName)
let languages = dataSource.selectGroupAndGetLanguages(for: groupName)

reloadData(with: languages, title: title)
}
Expand Down

0 comments on commit 0590025

Please sign in to comment.