Browse Source

Update PreferencesViewController.swift

pull/101/head 21.07.03
Abhishek 3 years ago
parent
commit
ca16b1c95e
  1. 29
      Clocker/Preferences/General/PreferencesViewController.swift

29
Clocker/Preferences/General/PreferencesViewController.swift

@ -660,28 +660,13 @@ extension PreferencesViewController {
isActivityInProgress = true isActivityInProgress = true
if availableTimezoneTableView.selectedRow == -1 { if availableTimezoneTableView.selectedRow == -1 {
messageLabel.stringValue = PreferencesConstants.noTimezoneSelectedErrorMessage timezonePanel.contentView?.makeToast(PreferencesConstants.noTimezoneSelectedErrorMessage)
Timer.scheduledTimer(withTimeInterval: 5,
repeats: false) { _ in
OperationQueue.main.addOperation {
self.messageLabel.stringValue = CLEmptyString
}
}
isActivityInProgress = false isActivityInProgress = false
return return
} }
if selectedTimeZones.count >= 100 { if selectedTimeZones.count >= 100 {
messageLabel.stringValue = PreferencesConstants.maxTimezonesErrorMessage timezonePanel.contentView?.makeToast(PreferencesConstants.maxTimezonesErrorMessage)
Timer.scheduledTimer(withTimeInterval: 5,
repeats: false) { _ in
OperationQueue.main.addOperation {
self.messageLabel.stringValue = CLEmptyString
}
}
isActivityInProgress = false isActivityInProgress = false
return return
} }
@ -855,20 +840,12 @@ extension PreferencesViewController {
} }
@IBAction func filterArray(_: Any?) { @IBAction func filterArray(_: Any?) {
messageLabel.stringValue = CLEmptyString
searchResultsDataSource.cleanupFilterArray() searchResultsDataSource.cleanupFilterArray()
if searchField.stringValue.count > 50 { if searchField.stringValue.count > 50 {
isActivityInProgress = false isActivityInProgress = false
messageLabel.stringValue = PreferencesConstants.maxCharactersAllowed
reloadSearchResults() reloadSearchResults()
Timer.scheduledTimer(withTimeInterval: 5, timezonePanel.contentView?.makeToast(PreferencesConstants.maxCharactersAllowed)
repeats: false) { _ in
OperationQueue.main.addOperation {
self.messageLabel.stringValue = CLEmptyString
}
}
return return
} }

Loading…
Cancel
Save