Fix character count with intent (#6056)
This commit is contained in:
@@ -224,7 +224,7 @@ function postReducer(state: PostDraft, action: PostAction): PostDraft {
|
|||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
richtext: action.richtext,
|
richtext: action.richtext,
|
||||||
shortenedGraphemeLength: shortenLinks(action.richtext).graphemeLength,
|
shortenedGraphemeLength: getShortenedLength(action.richtext),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 'update_labels': {
|
case 'update_labels': {
|
||||||
@@ -516,7 +516,7 @@ export function createComposerState({
|
|||||||
{
|
{
|
||||||
id: nanoid(),
|
id: nanoid(),
|
||||||
richtext: initRichText,
|
richtext: initRichText,
|
||||||
shortenedGraphemeLength: 0,
|
shortenedGraphemeLength: getShortenedLength(initRichText),
|
||||||
labels: [],
|
labels: [],
|
||||||
embed: {
|
embed: {
|
||||||
quote,
|
quote,
|
||||||
@@ -530,3 +530,7 @@ export function createComposerState({
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getShortenedLength(rt: RichText) {
|
||||||
|
return shortenLinks(rt).graphemeLength
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user