Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
No results found
Select Git revision
Show changes
Commits on Source (2)
......@@ -85,16 +85,16 @@ class Mounter: ObservableObject {
return _errorStatus
}
set {
// Thread-safe update and asynchronous notification
// Thread-safe update
_errorStatusLock.lock()
let shouldPostAuthError = newValue == .authenticationError
_errorStatus = newValue
_errorStatusLock.unlock()
// Notifications can be sent asynchronously
Task {
if newValue == .authenticationError {
NotificationCenter.default.post(name: .nsmNotification, object: nil, userInfo: ["AuthError": MounterError.authenticationError])
}
// Post notification synchronously after releasing the lock
if shouldPostAuthError {
NotificationCenter.default.post(name: .nsmNotification, object: nil,
userInfo: ["AuthError": MounterError.authenticationError])
}
}
}
......
......@@ -383,27 +383,35 @@ class NetworkShareMounterViewController: NSViewController, NSTableViewDelegate,
///
/// provide a method to react to certain events
@objc func handleErrorNotification(_ notification: NSNotification) {
if notification.userInfo?["krbOffDomain"] is Error {
DispatchQueue.main.async {
// Always dispatch UI updates to the main thread
DispatchQueue.main.async {
if notification.userInfo?["krbOffDomain"] is Error {
self.dogeAuthenticateButton.isEnabled = false
self.dogeAuthenticateHelp.isEnabled = false
self.dogeAuthenticateButton.title = NSLocalizedString("krb-offdomain-button", comment: "Button text for kerberos authentication")
}
} else if notification.userInfo?["KrbAuthError"] is Error {
DispatchQueue.main.async {
} else if notification.userInfo?["KrbAuthError"] is Error {
if self.enableKerberos {
self.dogeAuthenticateButton.isEnabled = true
self.dogeAuthenticateHelp.isEnabled = true
self.dogeAuthenticateButton.title = NSLocalizedString("missing-krb-auth-button", comment: "Button text for missing kerberos authentication")
}
}
} else if notification.userInfo?["krbAuthenticated"] is Error {
DispatchQueue.main.async {
} else if notification.userInfo?["krbAuthenticated"] is Error {
if self.enableKerberos {
self.dogeAuthenticateButton.isEnabled = true
self.dogeAuthenticateHelp.isEnabled = true
self.dogeAuthenticateButton.title = NSLocalizedString("krb-auth-button", comment: "Button text for kerberos authentication")
}
} else if notification.userInfo?["AuthError"] is MounterError {
// Update UI for authentication errors
Task {
self.refreshUserArray(type: .missingPassword)
self.toggleManagedSwitch.isHidden = true
self.additionalSharesText.isHidden = true
self.additionalSharesHelpButton.isHidden = true
self.modifyShareButton.title = NSLocalizedString("authenticate-share-button", comment: "Button text to change authentication")
self.networShareMounterExplanation.stringValue = NSLocalizedString("help-auth-error", comment: "Help text shown if some shares are not authenticated")
self.tableView.reloadData()
}
}
}
}
......
......@@ -711,7 +711,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 221;
CURRENT_PROJECT_VERSION = 222;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = C8F68RFW4L;
......@@ -761,7 +761,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 221;
CURRENT_PROJECT_VERSION = 222;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = C8F68RFW4L;
......