mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add share link in start chat flow (#926)
This commit is contained in:
@@ -28,6 +28,7 @@ enum StartChatScreenViewModelAction {
|
||||
}
|
||||
|
||||
struct StartChatScreenViewState: BindableState {
|
||||
let userID: String
|
||||
var bindings = StartChatScreenViewStateBindings()
|
||||
var usersSection: UserDiscoverySection = .init(type: .suggestions, users: [])
|
||||
|
||||
@@ -50,6 +51,5 @@ struct StartChatScreenViewStateBindings {
|
||||
enum StartChatScreenViewAction {
|
||||
case close
|
||||
case createRoom
|
||||
case inviteFriends
|
||||
case selectUser(UserProfile)
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class StartChatScreenViewModel: StartChatScreenViewModelType, StartChatScreenVie
|
||||
self.userSession = userSession
|
||||
self.userIndicatorController = userIndicatorController
|
||||
self.userDiscoveryService = userDiscoveryService
|
||||
super.init(initialViewState: StartChatScreenViewState(), imageProvider: userSession.mediaProvider)
|
||||
super.init(initialViewState: StartChatScreenViewState(userID: userSession.userID), imageProvider: userSession.mediaProvider)
|
||||
|
||||
setupBindings()
|
||||
}
|
||||
@@ -47,8 +47,6 @@ class StartChatScreenViewModel: StartChatScreenViewModelType, StartChatScreenVie
|
||||
actionsSubject.send(.close)
|
||||
case .createRoom:
|
||||
actionsSubject.send(.createRoom)
|
||||
case .inviteFriends:
|
||||
break
|
||||
case .selectUser(let user):
|
||||
showLoadingIndicator()
|
||||
Task {
|
||||
|
||||
@@ -74,7 +74,7 @@ struct StartChatScreen: View {
|
||||
|
||||
private var inviteFriendsSection: some View {
|
||||
Section {
|
||||
Button(action: inviteFriends) {
|
||||
MatrixUserShareLink(userID: context.viewState.userID) {
|
||||
Label(L10n.actionInviteFriendsToApp(InfoPlistReader.main.bundleDisplayName), systemImage: "square.and.arrow.up")
|
||||
}
|
||||
.buttonStyle(FormButtonStyle())
|
||||
@@ -121,10 +121,6 @@ struct StartChatScreen: View {
|
||||
context.send(viewAction: .createRoom)
|
||||
}
|
||||
|
||||
private func inviteFriends() {
|
||||
context.send(viewAction: .inviteFriends)
|
||||
}
|
||||
|
||||
private func close() {
|
||||
context.send(viewAction: .close)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user