@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/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/chat/provider.tsx +5 -2
package/package.json
CHANGED
package/src/chat/provider.tsx
CHANGED
|
@@ -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
|
|
91
|
-
|
|
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
|
}
|