mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
Handle exceptions when emojifier fails to provide uri for emoji icon (#856)
This commit is contained in:
parent
2d46bb52ad
commit
376b9a77a8
7 changed files with 53 additions and 25 deletions
|
@ -13,6 +13,7 @@ object Emojifier {
|
|||
* @param unicode emoji unicode
|
||||
* @return uri for loading emoji as image
|
||||
*/
|
||||
@Throws(IllegalStateException::class)
|
||||
fun uri(unicode: String): String {
|
||||
val (page, index) = search(unicode)
|
||||
return uri(page, index)
|
||||
|
@ -31,6 +32,7 @@ object Emojifier {
|
|||
* @param unicode emoji unicode
|
||||
* @return a pair constisting of emoji's page and emoji's index for this [unicode]
|
||||
*/
|
||||
@Throws(IllegalStateException::class)
|
||||
private fun search(unicode: String): Pair<Int, Int> {
|
||||
val cached = cache[unicode]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue