Verify profile before presenting interactive login (#893)
If the profile is ineligible for features other than .interactiveLogin, the interactive prompt would still be presented, but the user would hit the paywall right afterwards.
This commit is contained in:
parent
35c10309a7
commit
9528cecc27
|
@ -111,16 +111,15 @@ private extension TunnelToggleButton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if canConnect && profile.isInteractive {
|
if canConnect && profile.isInteractive {
|
||||||
|
do {
|
||||||
// ineligible, suppress interactive login
|
try iapManager.verify(profile)
|
||||||
if !iapManager.isEligible(for: .interactiveLogin) {
|
|
||||||
pp_log(.app, .notice, "Ineligible, suppress interactive login")
|
|
||||||
} else {
|
|
||||||
pp_log(.app, .notice, "Present interactive login")
|
pp_log(.app, .notice, "Present interactive login")
|
||||||
interactiveManager.present(with: profile) {
|
interactiveManager.present(with: profile) {
|
||||||
await perform(with: $0)
|
await perform(with: $0)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
} catch {
|
||||||
|
pp_log(.app, .notice, "Ineligible, suppress interactive login")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await perform(with: profile)
|
await perform(with: profile)
|
||||||
|
|
Loading…
Reference in New Issue