fix: issue in which reaction sheets may crash
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
29c1f2c569
commit
ae24104223
|
|
@ -122,7 +122,7 @@ suspend fun fetchUser(id: String): User {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val error = RevoltJson.decodeFromString(RevoltError.serializer(), response)
|
val error = RevoltJson.decodeFromString(RevoltError.serializer(), response)
|
||||||
throw Error(error.type)
|
throw Exception(error.type)
|
||||||
} catch (e: SerializationException) {
|
} catch (e: SerializationException) {
|
||||||
// Not an error
|
// Not an error
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,11 @@ fun ReactionInfoSheet(messageId: String, emoji: String, onDismiss: () -> Unit) {
|
||||||
|
|
||||||
LaunchedEffect(reaction) {
|
LaunchedEffect(reaction) {
|
||||||
if (reaction !in RevoltAPI.userCache) {
|
if (reaction !in RevoltAPI.userCache) {
|
||||||
RevoltAPI.userCache[reaction] = fetchUser(reaction)
|
try {
|
||||||
|
RevoltAPI.userCache[reaction] = fetchUser(reaction)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
// too bad!
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue