Skip to content

Commit

Permalink
fix: order of conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
bangjelkoski committed Sep 26, 2022
1 parent 4a5b4b8 commit 20b78e7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/sdk-ts/src/utils/grpc.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { grpc } from '@improbable-eng/grpc-web'
import { NodeHttpTransport } from '@improbable-eng/grpc-web-node-http-transport'
import { ReactNativeTransport } from '@improbable-eng/grpc-web-react-native-transport'
import { isBrowser, isNode, isReactNative } from './helpers'
import { isNode, isReactNative } from './helpers'

export const getGrpcTransport = (): grpc.TransportFactory | undefined => {
if (isBrowser()) {
return undefined
if (isReactNative()) {
return ReactNativeTransport({ withCredentials: true })
}

if (isNode()) {
return NodeHttpTransport()
}

if (isReactNative()) {
return ReactNativeTransport({ withCredentials: true })
}

return undefined
}

0 comments on commit 20b78e7

Please sign in to comment.