diff --git a/src/view/com/util/PostMeta.tsx b/src/view/com/util/PostMeta.tsx index 42c725a60d..77dfbb4857 100644 --- a/src/view/com/util/PostMeta.tsx +++ b/src/view/com/util/PostMeta.tsx @@ -20,6 +20,24 @@ interface PostMetaOpts { } export function PostMeta(opts: PostMetaOpts) { + let displayName = opts.authorDisplayName || opts.authorHandle + let handle = opts.authorHandle + + // HACK + // Android simply cannot handle the truncation case we need + // so we have to do it manually here + // -prf + if (displayName.length + handle.length > 26) { + if (displayName.length > 26) { + displayName = displayName.slice(0, 23) + '...' + } else { + handle = handle.slice(0, 23 - displayName.length) + '...' + if (handle.endsWith('....')) { + handle = handle.slice(0, -4) + '...' + } + } + } + return ( - {opts.authorDisplayName || opts.authorHandle} - -  {opts.authorHandle} - + {displayName} + {handle ? ( + +  {handle} + + ) : undefined} @@ -38,7 +58,7 @@ export function PostMeta(opts: PostMetaOpts) {