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()
data.setLabel(CLEmptyString)
if searchField.stringValue.isEmpty == false {
let currentSelection = searchResultsDataSource.timezoneFilteredArray[availableTimezoneTableView.selectedRow % searchResultsDataSource.timezoneFilteredArray.count]
let currentSelection = searchField.stringValue.isEmpty == false ? searchResultsDataSource.timezoneFilteredArray[availableTimezoneTableView.selectedRow % searchResultsDataSource.timezoneFilteredArray.count] :
searchResultsDataSource.timezoneArray[availableTimezoneTableView.selectedRow - 1]
let metaInfo = metadata(for: currentSelection)
data.timezoneID = metaInfo.0.name
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
let operationObject = TimezoneDataOperations(with: data)

Loading…
Cancel
Save