Skip to content

Commit 43b251e

Browse files
authored
Merge pull request #371 from rohit-nair/rn/develop-script
Standalone LiT client development
2 parents e8448a8 + 7bacc8d commit 43b251e

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"private": true,
77
"scripts": {
88
"start": "BROWSER=none react-scripts start",
9+
"develop": "REACT_APP_USE_SAMPLE_DATA=true yarn start",
910
"build": "react-scripts build",
1011
"test": "react-scripts test --env=jest-environment-jsdom",
1112
"test:ci": "cross-env CI=true yarn test --coverage",

app/src/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ const { protocol, hostname, port } = window.location;
1414
const host = `${protocol}//${hostname}:${port}`;
1515
// the GRPC server to make requests to
1616
export const DEV_HOST = process.env.REACT_APP_DEV_HOST || host;
17+
18+
export const USE_SAMPLE_DATA = process.env.REACT_APP_USE_SAMPLE_DATA === 'true';

app/src/store/store.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { autorun, makeAutoObservable, runInAction } from 'mobx';
2-
import { IS_DEV, IS_TEST } from 'config';
2+
import { IS_DEV, IS_TEST, USE_SAMPLE_DATA } from 'config';
33
import { createBrowserHistory, History } from 'history';
44
import AppStorage from 'util/appStorage';
55
import CsvExporter from 'util/csv';
@@ -200,6 +200,9 @@ export class Store {
200200
*/
201201
export const createStore = (grpcClient?: GrpcClient, appStorage?: AppStorage) => {
202202
const grpc = grpcClient || new GrpcClient();
203+
// Resolve api requests with sample data when running client in develop mode.
204+
grpc.useSampleData = USE_SAMPLE_DATA;
205+
203206
const storage = appStorage || new AppStorage();
204207
const lndApi = new LndApi(grpc);
205208
const loopApi = new LoopApi(grpc);

0 commit comments

Comments
 (0)