Skip to content

Commit ca16b1c

Browse files
committed
Update PreferencesViewController.swift
1 parent 530443d commit ca16b1c

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

Clocker/Preferences/General/PreferencesViewController.swift

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -660,28 +660,13 @@ extension PreferencesViewController {
660660
isActivityInProgress = true
661661

662662
if availableTimezoneTableView.selectedRow == -1 {
663-
messageLabel.stringValue = PreferencesConstants.noTimezoneSelectedErrorMessage
664-
665-
Timer.scheduledTimer(withTimeInterval: 5,
666-
repeats: false) { _ in
667-
OperationQueue.main.addOperation {
668-
self.messageLabel.stringValue = CLEmptyString
669-
}
670-
}
671-
663+
timezonePanel.contentView?.makeToast(PreferencesConstants.noTimezoneSelectedErrorMessage)
672664
isActivityInProgress = false
673665
return
674666
}
675667

676668
if selectedTimeZones.count >= 100 {
677-
messageLabel.stringValue = PreferencesConstants.maxTimezonesErrorMessage
678-
Timer.scheduledTimer(withTimeInterval: 5,
679-
repeats: false) { _ in
680-
OperationQueue.main.addOperation {
681-
self.messageLabel.stringValue = CLEmptyString
682-
}
683-
}
684-
669+
timezonePanel.contentView?.makeToast(PreferencesConstants.maxTimezonesErrorMessage)
685670
isActivityInProgress = false
686671
return
687672
}
@@ -855,20 +840,12 @@ extension PreferencesViewController {
855840
}
856841

857842
@IBAction func filterArray(_: Any?) {
858-
messageLabel.stringValue = CLEmptyString
859-
860843
searchResultsDataSource.cleanupFilterArray()
861844

862845
if searchField.stringValue.count > 50 {
863846
isActivityInProgress = false
864-
messageLabel.stringValue = PreferencesConstants.maxCharactersAllowed
865847
reloadSearchResults()
866-
Timer.scheduledTimer(withTimeInterval: 5,
867-
repeats: false) { _ in
868-
OperationQueue.main.addOperation {
869-
self.messageLabel.stringValue = CLEmptyString
870-
}
871-
}
848+
timezonePanel.contentView?.makeToast(PreferencesConstants.maxCharactersAllowed)
872849
return
873850
}
874851

0 commit comments

Comments
 (0)