Fix draft restore to calculate shortened grapheme length for links (#10103)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-03-24 13:31:19 -07:00
committed by GitHub
parent 894e2b89d4
commit fa84c451d0
+2 -1
View File
@@ -8,6 +8,7 @@ import {resolveLink} from '#/lib/api/resolve'
import {getDeviceName} from '#/lib/deviceName'
import {getImageDim} from '#/lib/media/manip'
import {mimeToExt} from '#/lib/media/video/util'
import {shortenLinks} from '#/lib/strings/rich-text-manip'
import {type ComposerImage} from '#/state/gallery'
import {type Gif} from '#/state/queries/tenor'
import {threadgateAllowUISettingToAllowRecordValue} from '#/state/queries/threadgate/util'
@@ -570,7 +571,7 @@ export async function draftToComposerPosts(
return {
id: `draft-post-${index}`,
richtext,
shortenedGraphemeLength: richtext.graphemeLength,
shortenedGraphemeLength: shortenLinks(richtext).graphemeLength,
labels,
embed,
} as PostDraft