@linktr.ee/messaging-react 1.12.6 → 1.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +223 -223
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelList/CustomChannelPreview.tsx +13 -5
package/package.json
CHANGED
|
@@ -37,15 +37,23 @@ const CustomChannelPreview = React.memo<CustomChannelPreviewProps>(
|
|
|
37
37
|
const lastMessage =
|
|
38
38
|
channel?.state?.messages?.[channel.state.messages.length - 1]
|
|
39
39
|
|
|
40
|
-
// Fallback order: text -> attachment URL -> "No messages yet"
|
|
41
40
|
const getLastMessageText = () => {
|
|
42
41
|
if (lastMessage?.text) return lastMessage.text
|
|
43
42
|
|
|
44
43
|
const attachment = lastMessage?.attachments?.[0]
|
|
45
|
-
if (attachment
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
if (attachment) {
|
|
45
|
+
// Link previews - show the actual URL
|
|
46
|
+
if (attachment.og_scrape_url) return attachment.og_scrape_url
|
|
47
|
+
|
|
48
|
+
// Type-based detection
|
|
49
|
+
if (attachment.type === 'image') return '📷 Sent an image'
|
|
50
|
+
if (attachment.type === 'video') return '🎥 Sent a video'
|
|
51
|
+
if (attachment.type === 'audio') return '🎵 Sent audio'
|
|
52
|
+
if (attachment.type === 'file') return '📎 Sent a file'
|
|
53
|
+
|
|
54
|
+
// Fallback
|
|
55
|
+
return '📎 Sent an attachment'
|
|
56
|
+
}
|
|
49
57
|
|
|
50
58
|
return 'No messages yet'
|
|
51
59
|
}
|