@dubsdotapp/expo 0.5.23 → 0.5.24
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 +9 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/chat/provider.tsx +8 -2
package/package.json
CHANGED
package/src/chat/provider.tsx
CHANGED
|
@@ -197,14 +197,20 @@ export function ChatProvider({ children, autoConnect = true }: ChatProviderProps
|
|
|
197
197
|
chatSocket.connect({ host, token });
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
// Refresh data to catch up on
|
|
200
|
+
// Refresh all key data to catch up on socket events that fired
|
|
201
|
+
// while the app was backgrounded (declines, accepts, cancels,
|
|
202
|
+
// new requests, friend removals, etc.)
|
|
201
203
|
refreshMessages();
|
|
204
|
+
refreshConversations().catch(() => {});
|
|
205
|
+
refreshFriends().catch(() => {});
|
|
206
|
+
refreshPendingRequests().catch(() => {});
|
|
207
|
+
refreshSentFriendRequests().catch(() => {});
|
|
202
208
|
}
|
|
203
209
|
};
|
|
204
210
|
|
|
205
211
|
const sub = AppState.addEventListener('change', handleAppState);
|
|
206
212
|
return () => sub.remove();
|
|
207
|
-
}, [client, refreshMessages, refreshConversations]);
|
|
213
|
+
}, [client, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests]);
|
|
208
214
|
|
|
209
215
|
const value = useMemo<ChatContextValue>(
|
|
210
216
|
() => ({
|