TV not presenting interactive login on "Connect" (#817)
The side panel was not shown when interactive login was triggered by the active profile on "Connect".
This commit is contained in:
parent
9286ead348
commit
9351ceeb6a
|
@ -50,7 +50,7 @@ struct ProfileView: View, TunnelInstallationProviding {
|
||||||
var tunnel: ExtendedTunnel
|
var tunnel: ExtendedTunnel
|
||||||
|
|
||||||
@State
|
@State
|
||||||
private var isSwitching = false
|
private var showsSidePanel = false
|
||||||
|
|
||||||
@FocusState
|
@FocusState
|
||||||
private var focusedField: Field?
|
private var focusedField: Field?
|
||||||
|
@ -73,7 +73,7 @@ struct ProfileView: View, TunnelInstallationProviding {
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
.disabled(interactiveManager.isPresented)
|
.disabled(interactiveManager.isPresented)
|
||||||
|
|
||||||
if isSwitching {
|
if showsSidePanel {
|
||||||
ZStack {
|
ZStack {
|
||||||
listView
|
listView
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
|
@ -91,12 +91,12 @@ struct ProfileView: View, TunnelInstallationProviding {
|
||||||
}
|
}
|
||||||
.ignoresSafeArea(edges: .horizontal)
|
.ignoresSafeArea(edges: .horizontal)
|
||||||
.background(theme.primaryColor.gradient)
|
.background(theme.primaryColor.gradient)
|
||||||
.themeAnimation(on: isSwitching, category: .profiles)
|
.themeAnimation(on: showsSidePanel, category: .profiles)
|
||||||
.withErrorHandler(errorHandler)
|
.withErrorHandler(errorHandler)
|
||||||
.defaultFocus($focusedField, .switchProfile)
|
.defaultFocus($focusedField, .switchProfile)
|
||||||
.onChange(of: tunnel.status) { _, new in
|
.onChange(of: tunnel.status) { _, new in
|
||||||
if new == .activating {
|
if new == .activating {
|
||||||
isSwitching = false
|
showsSidePanel = false
|
||||||
focusedField = .connect
|
focusedField = .connect
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,13 +105,18 @@ struct ProfileView: View, TunnelInstallationProviding {
|
||||||
focusedField = .switchProfile
|
focusedField = .switchProfile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.onChange(of: interactiveManager.isPresented) { _, new in
|
||||||
|
if new {
|
||||||
|
showsSidePanel = true
|
||||||
|
}
|
||||||
|
}
|
||||||
.onChange(of: focusedField) { _, new in
|
.onChange(of: focusedField) { _, new in
|
||||||
switch new {
|
switch new {
|
||||||
case .connect:
|
case .connect:
|
||||||
isSwitching = false
|
showsSidePanel = false
|
||||||
|
|
||||||
case .switchProfile:
|
case .switchProfile:
|
||||||
isSwitching = true
|
showsSidePanel = true
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
|
@ -132,7 +137,7 @@ private extension ProfileView {
|
||||||
ActiveProfileView(
|
ActiveProfileView(
|
||||||
profile: currentProfile,
|
profile: currentProfile,
|
||||||
tunnel: tunnel,
|
tunnel: tunnel,
|
||||||
isSwitching: $isSwitching,
|
isSwitching: $showsSidePanel,
|
||||||
focusedField: $focusedField,
|
focusedField: $focusedField,
|
||||||
interactiveManager: interactiveManager,
|
interactiveManager: interactiveManager,
|
||||||
errorHandler: errorHandler
|
errorHandler: errorHandler
|
||||||
|
|
Loading…
Reference in New Issue