fix: address code review issues for embeds implementation
- Fix ?? to || in metadataFetcher.ts to handle empty strings from Cheerio - Fix stale embeds on message edit: delete old embeds synchronously before broadcast, then resolve new ones async (all 4 edit paths: REST+WS, msg+DM) - Revert unrelated MessageList.tsx scroll threshold change (5000 not 150) - Remove duplicate embed indexes from migrateAddIndexes (kept standalone ones)
This commit is contained in:
@@ -134,7 +134,7 @@ export function MessageList({ channelId, jumpToMessageId, onJumpComplete }: Mess
|
||||
if (el) {
|
||||
el.scrollIntoView({ block: 'start' });
|
||||
const dist = container.scrollHeight - container.scrollTop - container.clientHeight;
|
||||
const near = dist < 150;
|
||||
const near = dist < 5000;
|
||||
setIsNearBottom(near);
|
||||
isNearBottomRef.current = near;
|
||||
return;
|
||||
@@ -218,7 +218,7 @@ export function MessageList({ channelId, jumpToMessageId, onJumpComplete }: Mess
|
||||
|
||||
// Check if near bottom
|
||||
const distanceFromBottom = container.scrollHeight - container.scrollTop - container.clientHeight;
|
||||
const nearBottom = distanceFromBottom < 150;
|
||||
const nearBottom = distanceFromBottom < 5000;
|
||||
setIsNearBottom(nearBottom);
|
||||
isNearBottomRef.current = nearBottom;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user