Browse Source

Trimming logic.

pull/92/head
Abhishek 5 years ago
parent
commit
6793325b38
  1. 13
      Clocker/Preferences/General/PreferencesViewController.swift

13
Clocker/Preferences/General/PreferencesViewController.swift

@ -803,21 +803,12 @@ extension PreferencesViewController {
let data = TimezoneData() let data = TimezoneData()
data.setLabel(CLEmptyString) data.setLabel(CLEmptyString)
if searchField.stringValue.isEmpty == false { let currentSelection = searchField.stringValue.isEmpty == false ? searchResultsDataSource.timezoneFilteredArray[availableTimezoneTableView.selectedRow % searchResultsDataSource.timezoneFilteredArray.count] :
let currentSelection = searchResultsDataSource.timezoneFilteredArray[availableTimezoneTableView.selectedRow % searchResultsDataSource.timezoneFilteredArray.count] searchResultsDataSource.timezoneArray[availableTimezoneTableView.selectedRow - 1]
let metaInfo = metadata(for: currentSelection) let metaInfo = metadata(for: currentSelection)
data.timezoneID = metaInfo.0.name data.timezoneID = metaInfo.0.name
data.formattedAddress = metaInfo.1.formattedName data.formattedAddress = metaInfo.1.formattedName
} else {
let currentSelection = searchResultsDataSource.timezoneArray[availableTimezoneTableView.selectedRow - 1]
let metaInfo = metadata(for: currentSelection)
data.timezoneID = metaInfo.0.name
data.formattedAddress = metaInfo.1.formattedName
}
data.selectionType = .timezone data.selectionType = .timezone
let operationObject = TimezoneDataOperations(with: data) let operationObject = TimezoneDataOperations(with: data)

Loading…
Cancel
Save