Skip to content

Commit bea8146

Browse files
committed
fix externall device info crash when blank
1 parent acd14f0 commit bea8146

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/react-query-external-sync/useMySocket.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ export function useMySocket({
109109
deviceName,
110110
deviceId: persistentDeviceId,
111111
platform,
112-
extraDeviceInfo: JSON.stringify(extraDeviceInfo),
112+
...(extraDeviceInfo && Object.keys(extraDeviceInfo).length > 0
113+
? { extraDeviceInfo: JSON.stringify(extraDeviceInfo) }
114+
: {}),
113115
},
114116
reconnection: false,
115117
transports: ["websocket"], // Prefer websocket transport for React Native

0 commit comments

Comments
 (0)