|
|
@ -23,22 +23,25 @@ struct ContentView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private var showLoginSheet: Binding<Bool> { |
|
|
|
|
|
|
|
Binding { |
|
|
|
|
|
|
|
!connection.authenticated |
|
|
|
|
|
|
|
} set: { _ in |
|
|
|
|
|
|
|
// swallow |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ViewBuilder |
|
|
|
@ViewBuilder |
|
|
|
private var content: some View { |
|
|
|
private var content: some View { |
|
|
|
if !connection.authenticated { |
|
|
|
NavigationView { |
|
|
|
LoginView { info in |
|
|
|
ConversationListWrapper(selectedConversation: $selectedConversation) |
|
|
|
Task { |
|
|
|
selectedConversation.map { |
|
|
|
await connection.connect(info: info) |
|
|
|
ConversationViewWrapper(conversation: $0) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
.sheet(isPresented: showLoginSheet) { |
|
|
|
NavigationView { |
|
|
|
loginOverlay |
|
|
|
ConversationListWrapper(selectedConversation: $selectedConversation) |
|
|
|
|
|
|
|
selectedConversation.map { |
|
|
|
|
|
|
|
ConversationViewWrapper(conversation: $0) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|