@dubsdotapp/expo 0.5.26 → 0.5.27
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 +15 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/chat/provider.tsx +13 -1
package/dist/index.js
CHANGED
|
@@ -8857,7 +8857,21 @@ function ChatProvider({ children, autoConnect = true }) {
|
|
|
8857
8857
|
const baseUrl = client.baseUrl;
|
|
8858
8858
|
const host = new URL(baseUrl).origin;
|
|
8859
8859
|
chatSocket.setListeners({
|
|
8860
|
-
|
|
8860
|
+
// Refetch the message list whenever the socket reaches 'connected'.
|
|
8861
|
+
// Covers both the initial connect AND every reconnect (app resumed
|
|
8862
|
+
// from background, transient network blip, server restart). Without
|
|
8863
|
+
// this, the provider's `messages` state is frozen at whatever it was
|
|
8864
|
+
// when the app last connected — Socket.IO's auto-reconnect resumes
|
|
8865
|
+
// delivery of *new* events but does not replay the gap.
|
|
8866
|
+
onConnectionChange: (next) => {
|
|
8867
|
+
setStatus(next);
|
|
8868
|
+
if (next === "connected") {
|
|
8869
|
+
refreshMessages().catch(() => {
|
|
8870
|
+
});
|
|
8871
|
+
refreshConversations().catch(() => {
|
|
8872
|
+
});
|
|
8873
|
+
}
|
|
8874
|
+
},
|
|
8861
8875
|
// Global chat
|
|
8862
8876
|
onNewMessage: (msg) => {
|
|
8863
8877
|
setMessages((prev) => {
|