Skip to content

Commit

Permalink
Update PreferencesViewController.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
n0shake committed Jul 10, 2021
1 parent 530443d commit ca16b1c
Showing 1 changed file with 3 additions and 26 deletions.
29 changes: 3 additions & 26 deletions Clocker/Preferences/General/PreferencesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -660,28 +660,13 @@ extension PreferencesViewController {
isActivityInProgress = true

if availableTimezoneTableView.selectedRow == -1 {
messageLabel.stringValue = PreferencesConstants.noTimezoneSelectedErrorMessage

Timer.scheduledTimer(withTimeInterval: 5,
repeats: false) { _ in
OperationQueue.main.addOperation {
self.messageLabel.stringValue = CLEmptyString
}
}

timezonePanel.contentView?.makeToast(PreferencesConstants.noTimezoneSelectedErrorMessage)
isActivityInProgress = false
return
}

if selectedTimeZones.count >= 100 {
messageLabel.stringValue = PreferencesConstants.maxTimezonesErrorMessage
Timer.scheduledTimer(withTimeInterval: 5,
repeats: false) { _ in
OperationQueue.main.addOperation {
self.messageLabel.stringValue = CLEmptyString
}
}

timezonePanel.contentView?.makeToast(PreferencesConstants.maxTimezonesErrorMessage)
isActivityInProgress = false
return
}
Expand Down Expand Up @@ -855,20 +840,12 @@ extension PreferencesViewController {
}

@IBAction func filterArray(_: Any?) {
messageLabel.stringValue = CLEmptyString

searchResultsDataSource.cleanupFilterArray()

if searchField.stringValue.count > 50 {
isActivityInProgress = false
messageLabel.stringValue = PreferencesConstants.maxCharactersAllowed
reloadSearchResults()
Timer.scheduledTimer(withTimeInterval: 5,
repeats: false) { _ in
OperationQueue.main.addOperation {
self.messageLabel.stringValue = CLEmptyString
}
}
timezonePanel.contentView?.makeToast(PreferencesConstants.maxCharactersAllowed)
return
}

Expand Down

0 comments on commit ca16b1c

Please sign in to comment.