Skip to content

Commit

Permalink
PKG -- [fcl] Fix react native platform in fcl.mutate (onflow#1755)
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink authored Aug 14, 2023
1 parent c0ba4d2 commit 28d16a1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-scissors-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@onflow/fcl": patch
---

Fix react-native platform for `fcl.mutate`
15 changes: 10 additions & 5 deletions packages/fcl/src/fcl-react-native.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export * from './shared-exports';
export * from "./shared-exports"

import {getMutate} from "./exec/mutate"
export const mutate = getMutate({platform: "web"})
export const mutate = getMutate({platform: "react-native"})

import {getCurrentUser} from "./current-user"
const currentUser = getCurrentUser({platform:"react-native"})
const currentUser = getCurrentUser({platform: "react-native"})

export {currentUser}

Expand All @@ -20,9 +20,14 @@ export const logIn = (opts = {}) => currentUser().authenticate(opts)
export const authz = currentUser().authorization

import {config} from "@onflow/config"
import {coreStrategies, getDefaultConfig, useServiceDiscovery, ServiceDiscovery} from "./utils/react-native"
import {
coreStrategies,
getDefaultConfig,
useServiceDiscovery,
ServiceDiscovery,
} from "./utils/react-native"
import {initServiceRegistry} from "./current-user/exec-service/plugins"
import {setIsReactNative} from './utils/is-react-native';
import {setIsReactNative} from "./utils/is-react-native"

config(getDefaultConfig())

Expand Down

0 comments on commit 28d16a1

Please sign in to comment.