@dubsdotapp/expo 0.5.27 → 0.5.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dubsdotapp/expo",
3
- "version": "0.5.27",
3
+ "version": "0.5.28",
4
4
  "description": "React Native SDK for the Dubs betting platform",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -87,8 +87,11 @@ export function ChatProvider({ children, autoConnect = true }: ChatProviderProps
87
87
  const refreshMessages = useCallback(async () => {
88
88
  try {
89
89
  const res = await client.getChatMessages({ limit: 30 });
90
- // API returns newest-first keep that order for inverted FlatList
91
- setMessages(res.messages);
90
+ // The dev API returns messages oldest-first (chatService applies a
91
+ // .reverse() for legacy chat-order callers). Inverted chat FlatLists
92
+ // — and onNewMessage's prepend below — assume newest-first. Flip
93
+ // here so the internal store is consistent everywhere.
94
+ setMessages([...res.messages].reverse());
92
95
  } catch (err) {
93
96
  console.error('[Dubs:ChatProvider] Failed to load messages:', err);
94
97
  }