Proper display of unresolved names in mentions (#1530)

* Fix issue with span being the full length

* Making sure a mention with a username without a resolved name still displayed with the appropriate style with the truncated is
This commit is contained in:
ThomasSession
2024-07-05 10:48:51 +10:00
committed by GitHub
parent bbb1b2b517
commit 15b3b18321
2 changed files with 3 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
package org.session.libsession.utilities
fun truncateIdForDisplay(id: String): String =
id.takeIf { it.length > 8 }?.apply{ "${take(4)}${takeLast(4)}" } ?: id
id.takeIf { it.length > 8 }?.run{ "${take(4)}${takeLast(4)}" } ?: id