Skip to content

Commit

Permalink
remove the platform checks
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh62 committed Oct 21, 2024
1 parent 92999d1 commit 3a23e6b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,11 @@ class ShowHostedUISignOut: NSObject, Action {
do {
let logoutURL = try HostedUIRequestHelper.createSignOutURL(configuration: hostedUIConfig)
let sessionAdapter = hostedUIEnvironment.hostedUISessionFactory()
#if os(iOS) || os(macOS) || os(visionOS)
_ = try await sessionAdapter.showHostedUI(
url: logoutURL,
callbackScheme: callbackURLScheme,
inPrivate: false,
presentationAnchor: signOutEvent.presentationAnchor)
#else
_ = try await sessionAdapter.showHostedUI(
url: logoutURL,
callbackScheme: callbackURLScheme,
inPrivate: false,
presentationAnchor: nil)
#endif
await sendEvent(with: nil, dispatcher: dispatcher, environment: environment)
} catch {
self.logVerbose("\(#fileID) Received error \(error)", environment: environment)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@ struct SignOutEventData {

let globalSignOut: Bool

#if os(iOS) || os(macOS) || os(visionOS)
let presentationAnchor: AuthUIPresentationAnchor?

init(globalSignOut: Bool, presentationAnchor: AuthUIPresentationAnchor? = nil) {
self.globalSignOut = globalSignOut
self.presentationAnchor = presentationAnchor
}
#else
init(globalSignOut: Bool) {
self.globalSignOut = globalSignOut
}
#endif
}

extension SignOutEventData: Equatable { }
Expand Down Expand Up @@ -50,9 +44,8 @@ extension SignOutEventData: Codable {
init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: CodingKeys.self)
globalSignOut = try values.decode(Bool.self, forKey: .globalSignOut)
#if os(iOS) || os(macOS) || os(visionOS)
presentationAnchor = nil
#endif

}

func encode(to encoder: Encoder) throws {
Expand Down

0 comments on commit 3a23e6b

Please sign in to comment.