From ca16b1c95e82e70a4375fd08e95fb73816aeaefc Mon Sep 17 00:00:00 2001 From: Abhishek Date: Sat, 10 Jul 2021 16:45:38 -0400 Subject: [PATCH] Update PreferencesViewController.swift --- .../General/PreferencesViewController.swift | 29 ++----------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/Clocker/Preferences/General/PreferencesViewController.swift b/Clocker/Preferences/General/PreferencesViewController.swift index 59f1028..2f2eb21 100644 --- a/Clocker/Preferences/General/PreferencesViewController.swift +++ b/Clocker/Preferences/General/PreferencesViewController.swift @@ -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 } @@ -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 }