mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
show alert when trying to accept invalid invites
This commit is contained in:
@@ -416,8 +416,13 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
isSpace: roomProxy.info.isSpace,
|
||||
activeMemberCount: UInt(roomProxy.info.activeMembersCount))
|
||||
appSettings.seenInvites.remove(roomID)
|
||||
case .failure:
|
||||
displayError()
|
||||
case .failure(let error):
|
||||
switch error {
|
||||
case .invalidInvite:
|
||||
displayError(title: L10n.dialogTitleError, message: L10n.errorInvalidInvite)
|
||||
default:
|
||||
displayError()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -474,9 +479,9 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
}
|
||||
}
|
||||
|
||||
private func displayError() {
|
||||
private func displayError(title: String? = nil, message: String? = nil) {
|
||||
state.bindings.alertInfo = .init(id: UUID(),
|
||||
title: L10n.commonError,
|
||||
message: L10n.errorUnknown)
|
||||
title: title ?? L10n.commonError,
|
||||
message: message ?? L10n.errorUnknown)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user