tangled
alpha
login
or
join now
stream.place
/
streamplace
74
fork
atom
Live video on the AT Protocol
74
fork
atom
overview
issues
1
pulls
pipelines
fix: accurate char counting
ElshadHu
2 months ago
584104c3
d4ad562d
+2
-2
1 changed file
expand all
collapse all
unified
split
js
components
src
components
chat
chat-box.tsx
+2
-2
js/components/src/components/chat/chat-box.tsx
···
65
65
new Map(),
66
66
);
67
67
const [filteredEmojis, setFilteredEmojis] = useState<any[]>([]);
68
68
-
const isOverLimit = [...message].length > 300;
68
68
+
const isOverLimit = [...new Intl.Segmenter().segment(message)].length > 300;
69
69
70
70
let linfo = useLivestream();
71
71
···
256
256
257
257
const submit = async () => {
258
258
if (!message.trim()) return;
259
259
-
if ([...message].length > 300) {
259
259
+
if ([...new Intl.Segmenter().segment(message)].length > 300) {
260
260
toast.show(
261
261
"Message too long",
262
262
"Please limit your message to 300 characters.",