@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dubsdotapp/expo",
3
- "version": "0.5.23",
3
+ "version": "0.5.24",
4
4
  "description": "React Native SDK for the Dubs betting platform",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -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 missed events
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
  () => ({