Prevent crash with duplicate room suggestion

If two rooms have the same canonical alias, e.g. the recently tombstoned
and upgraded #foundation-office:matrix.org, typing `#foun` into the
composer could cause the app to crash. This avoids that by using the
(hopefully) globally unique room id as the key instead.

Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
Joe Groocock 2024-10-01 20:58:55 +00:00
parent f344a1282c
commit 7f3ebbb85d
No known key found for this signature in database
GPG key ID: A5571FCDC53ADDE6

View file

@ -60,7 +60,7 @@ fun SuggestionsPickerView(
when (suggestion) {
is ResolvedSuggestion.AtRoom -> "@room"
is ResolvedSuggestion.Member -> suggestion.roomMember.userId.value
is ResolvedSuggestion.Alias -> suggestion.roomAlias.value
is ResolvedSuggestion.Alias -> suggestion.roomSummary.roomId.value
}
}
) {