Fix the reaction content type and the fixable lint sites. [skip build]
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
EventTimeline,
|
||||
EventTimelineSet,
|
||||
EventTimelineSetHandlerMap,
|
||||
EventType,
|
||||
IContent,
|
||||
MatrixClient,
|
||||
MatrixEvent,
|
||||
@@ -1529,7 +1530,7 @@ export function RoomTimeline({ room, eventId, roomInputRef, editor }: RoomTimeli
|
||||
(reactions.find(eventWithShortcode)?.getContent().shortcode as string | undefined);
|
||||
mx.sendEvent(
|
||||
room.roomId,
|
||||
MessageEvent.Reaction as any,
|
||||
EventType.Reaction,
|
||||
getReactionContent(targetEventId, key, rShortcode),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -50,7 +50,8 @@ export const RoomViewTyping = as<'div', RoomViewTypingProps>(
|
||||
// One verb for everyone keeps the joined form; mixed verbs need a clause per person
|
||||
const firstVerb = verbs[typers[0].userId];
|
||||
const sameVerb = typers.every((typer) => verbs[typer.userId] === firstVerb);
|
||||
const clauses = entries.map((entry) => ({
|
||||
const clauses = entries.map((entry, index) => ({
|
||||
key: entry.plural ? 'others' : typers[index].userId,
|
||||
name: entry.name,
|
||||
suffix: `${entry.plural ? 'are' : 'is'} ${entry.verb ?? DEFAULT_VERB}`,
|
||||
}));
|
||||
@@ -81,7 +82,7 @@ export const RoomViewTyping = as<'div', RoomViewTypingProps>(
|
||||
<TypingIndicator />
|
||||
<Text className={css.TypingText} size="T300" truncate>
|
||||
{clauses.map((clause, index) => (
|
||||
<React.Fragment key={index}>
|
||||
<React.Fragment key={clause.key}>
|
||||
{index > 0 && (index === clauses.length - 1 ? ' and ' : ', ')}
|
||||
<b>{clause.name}</b>
|
||||
{!sharedSuffix && ` ${clause.suffix}`}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useMemo, useRef } from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { EmojiConfettiBurst } from './types';
|
||||
import {
|
||||
@@ -238,7 +238,7 @@ function LocalBurstCanvas({ burst, primaryEmoji, onComplete }: BurstCanvasProps)
|
||||
[burst.origin.maskRadius, canvasSize],
|
||||
);
|
||||
|
||||
const updateLayerPosition = () => {
|
||||
const updateLayerPosition = useCallback(() => {
|
||||
const layer = layerRef.current;
|
||||
if (!layer) return false;
|
||||
|
||||
@@ -249,7 +249,7 @@ function LocalBurstCanvas({ burst, primaryEmoji, onComplete }: BurstCanvasProps)
|
||||
layer.style.left = `${rect.left + rect.width / 2 - canvasSize / 2}px`;
|
||||
layer.style.top = `${rect.top + rect.height / 2 - canvasSize / 2}px`;
|
||||
return true;
|
||||
};
|
||||
}, [burst.targetEventId, canvasSize]);
|
||||
|
||||
useEffect(() => {
|
||||
const onScrollOrResize = () => {
|
||||
@@ -263,7 +263,7 @@ function LocalBurstCanvas({ burst, primaryEmoji, onComplete }: BurstCanvasProps)
|
||||
window.removeEventListener('scroll', onScrollOrResize, true);
|
||||
window.removeEventListener('resize', onScrollOrResize);
|
||||
};
|
||||
}, [burst.targetEventId, canvasSize]);
|
||||
}, [burst.targetEventId, canvasSize, updateLayerPosition]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!canvasRef.current || spawnedRef.current) return undefined;
|
||||
@@ -348,7 +348,7 @@ function LocalBurstCanvas({ burst, primaryEmoji, onComplete }: BurstCanvasProps)
|
||||
window.clearInterval(retry);
|
||||
frameCleanup?.();
|
||||
};
|
||||
}, [burst.id, burst.targetEventId, canvasSize, localOrigin, primaryEmoji]);
|
||||
}, [burst.id, burst.targetEventId, canvasSize, localOrigin, primaryEmoji, updateLayerPosition]);
|
||||
|
||||
return createPortal(
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user