@@ -9,6 +9,7 @@ import { AsyncStorage, Clipboard } from 'react-native';
99import { nap } from '../helper' ;
1010import store from '../store' ;
1111import AppStorage from './app-storage' ;
12+ import IpcAction from './ipc' ;
1213import GrpcAction from './grpc' ;
1314import NavAction from './nav' ;
1415import WalletAction from './wallet' ;
@@ -21,18 +22,17 @@ import PaymentAction from './payment';
2122import InvoiceAction from './invoice' ;
2223import SettingAction from './setting' ;
2324
24- const ipcRenderer = window . ipcRenderer ; // exposed to sandbox via preload.js
25-
2625//
2726// Inject dependencies
2827//
2928
3029store . init ( ) ; // initialize computed values
3130
31+ export const ipc = new IpcAction ( window . ipcRenderer ) ;
3232export const db = new AppStorage ( store , AsyncStorage ) ;
33- export const log = new LogAction ( store , ipcRenderer ) ;
33+ export const log = new LogAction ( store , ipc ) ;
3434export const nav = new NavAction ( store ) ;
35- export const grpc = new GrpcAction ( store , ipcRenderer ) ;
35+ export const grpc = new GrpcAction ( store , ipc ) ;
3636export const notify = new NotificationAction ( store , nav ) ;
3737export const wallet = new WalletAction ( store , grpc , db , nav , notify ) ;
3838export const info = new InfoAction ( store , grpc , nav , notify ) ;
@@ -47,9 +47,9 @@ export const invoice = new InvoiceAction(
4747 Clipboard
4848) ;
4949export const payment = new PaymentAction ( store , grpc , transaction , nav , notify ) ;
50- export const setting = new SettingAction ( store , wallet , db ) ;
50+ export const setting = new SettingAction ( store , wallet , db , ipc ) ;
5151
52- payment . listenForUrl ( ipcRenderer ) ; // enable incoming url handler
52+ payment . listenForUrl ( ipc ) ; // enable incoming url handler
5353
5454//
5555// Init actions
@@ -71,6 +71,14 @@ observe(store, 'unlockerReady', async () => {
7171 await wallet . init ( ) ;
7272} ) ;
7373
74+ /**
75+ * Triggered the first time the app was started e.g. to set the
76+ * local fiat currency only once.
77+ */
78+ observe ( store , 'firstStart' , async ( ) => {
79+ await setting . detectLocalCurrency ( ) ;
80+ } ) ;
81+
7482/**
7583 * Triggered after the user's password has unlocked the wallet.
7684 */
0 commit comments