fix: issue in which reaction sheets may crash

Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
Infi 2024-10-28 02:24:44 +01:00
parent 29c1f2c569
commit ae24104223
2 changed files with 6 additions and 2 deletions

View File

@ -122,7 +122,7 @@ suspend fun fetchUser(id: String): User {
try {
val error = RevoltJson.decodeFromString(RevoltError.serializer(), response)
throw Error(error.type)
throw Exception(error.type)
} catch (e: SerializationException) {
// Not an error
}

View File

@ -310,7 +310,11 @@ fun ReactionInfoSheet(messageId: String, emoji: String, onDismiss: () -> Unit) {
LaunchedEffect(reaction) {
if (reaction !in RevoltAPI.userCache) {
RevoltAPI.userCache[reaction] = fetchUser(reaction)
try {
RevoltAPI.userCache[reaction] = fetchUser(reaction)
} catch (e: Exception) {
// too bad!
}
}
}