Skip to content

Commit

Permalink
Use environment variable to load live data (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
dguenther authored Dec 13, 2024
1 parent 22f22ad commit 1cbfc03
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ This project was generated using [Nx](https://nx.dev).

### Running the Mobile App

1. The app uses demo data by default. To use wallet servers instead, copy `packages/mobile-app/.env.template` to `packages/mobile-app/.env` and set `EXPO_PUBLIC_DEMO_API=false`.

1. In a terminal, build and run the iOS app:
- `nx ios mobile-app`

Expand Down
8 changes: 0 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/mobile-app/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EXPO_PUBLIC_DEMO_API=true
4 changes: 2 additions & 2 deletions packages/mobile-app/data/facades/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { chainHandlers } from "./chain/oreowalletHandlers";
import { chainDemoHandlers } from "./chain/demoHandlers";
import { contactsDemoHandlers } from "./contacts/demoHandlers";

const DEMO = true;
const DEMO_API = Boolean(process.env.EXPO_PUBLIC_DEMO_API ?? true);

export const facadeContext = createFacadeContext(
DEMO
DEMO_API
? {
...appDemoHandlers,
...chainDemoHandlers,
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile-app/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
global.Buffer = require("buffer").Buffer;
global.process = require("process");
process.argv = [];

require("expo-router/entry");

Expand Down
1 change: 0 additions & 1 deletion packages/mobile-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"kysely": "^0.27.3",
"kysely-expo": "2.0.3",
"long": "^5.2.3",
"process": "^0.11.10",
"protobufjs": "^7.3.0",
"react": "18.2.0",
"react-native": "0.75.4",
Expand Down

0 comments on commit 1cbfc03

Please sign in to comment.