Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
lightning-bits
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bitsoko services
lightning-bits
Commits
ccae1afd
Unverified
Commit
ccae1afd
authored
May 15, 2019
by
Tankred Hase
Committed by
GitHub
May 15, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1107 from lightninglabs/dev/prevent-back-navigation-from-home
Dev/prevent back navigation from home
parents
f39cb66f
04312758
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
11 deletions
+35
-11
index-mobile.js
src/action/index-mobile.js
+2
-2
nav-mobile.js
src/action/nav-mobile.js
+21
-4
main-mobile.js
src/view/main-mobile.js
+12
-5
No files found.
src/action/index-mobile.js
View file @
ccae1afd
...
...
@@ -15,7 +15,7 @@ import {
// NativeEventEmitter,
}
from
'react-native'
;
import
{
SecureStore
,
LocalAuthentication
,
Linking
}
from
'expo'
;
import
{
NavigationActions
}
from
'react-navigation'
;
import
{
NavigationActions
,
StackActions
}
from
'react-navigation'
;
import
{
nap
}
from
'../helper'
;
import
store
from
'../store'
;
import
AppStorage
from
'./app-storage'
;
...
...
@@ -47,7 +47,7 @@ export const grpc = sinon.createStubInstance(GrpcAction); // STUB DURING DEVELOP
// export const ipc = new IpcAction(grpc);
export
const
ipc
=
sinon
.
createStubInstance
(
IpcAction
);
// STUB DURING DEVELOPMENT
export
const
log
=
new
LogAction
(
store
,
ipc
,
false
);
export
const
nav
=
new
NavAction
(
store
,
NavigationActions
);
export
const
nav
=
new
NavAction
(
store
,
NavigationActions
,
StackActions
);
export
const
notify
=
new
NotificationAction
(
store
,
nav
);
export
const
wallet
=
new
WalletAction
(
store
,
grpc
,
db
,
nav
,
notify
);
export
const
info
=
new
InfoAction
(
store
,
grpc
,
nav
,
notify
);
...
...
src/action/nav-mobile.js
View file @
ccae1afd
...
...
@@ -5,14 +5,29 @@
*/
class
NavAction
{
constructor
(
store
,
Navigation
)
{
constructor
(
store
,
Navigation
Actions
,
StackActions
)
{
this
.
_store
=
store
;
this
.
_Navigation
=
Navigation
;
this
.
_navActions
=
NavigationActions
;
this
.
_stackActions
=
StackActions
;
}
setTopLevelNavigator
(
navigatorRef
)
{
this
.
_navigate
=
(
routeName
,
params
)
=>
navigatorRef
.
dispatch
(
this
.
_Navigation
.
navigate
({
routeName
,
params
}));
this
.
_navigate
=
routeName
=>
navigatorRef
.
dispatch
(
this
.
_navActions
.
navigate
({
routeName
}));
this
.
_reset
=
(
stackName
,
routeName
)
=>
navigatorRef
.
dispatch
(
this
.
_stackActions
.
reset
({
index
:
0
,
actions
:
[
this
.
_navActions
.
navigate
({
routeName
:
stackName
,
action
:
this
.
_navActions
.
navigate
({
routeName
}),
}),
],
})
);
this
.
_store
.
navReady
=
true
;
}
...
...
@@ -70,6 +85,7 @@ class NavAction {
goLoaderSyncing
()
{
this
.
_navigate
(
'LoaderSyncing'
);
this
.
_reset
(
'Main'
,
'LoaderSyncing'
);
}
goWait
()
{
...
...
@@ -78,6 +94,7 @@ class NavAction {
goHome
()
{
this
.
_navigate
(
'Home'
);
this
.
_reset
(
'Main'
,
'Home'
);
}
goPay
()
{
...
...
src/view/main-mobile.js
View file @
ccae1afd
...
...
@@ -194,11 +194,6 @@ const MainStack = createStackNavigator(
Password
,
LoaderSyncing
,
Home
,
Settings
,
SettingsUnit
,
SettingsFiat
,
CLI
,
Notifications
,
},
stackOptions
);
...
...
@@ -243,6 +238,17 @@ const ChannelStack = createStackNavigator(
stackOptions
);
const
SettingStack
=
createStackNavigator
(
{
Settings
,
SettingsUnit
,
SettingsFiat
,
CLI
,
Notifications
,
},
stackOptions
);
const
RootStack
=
createStackNavigator
(
{
Main
:
MainStack
,
...
...
@@ -250,6 +256,7 @@ const RootStack = createStackNavigator(
Pay
:
PayStack
,
Transactions
:
TransactionStack
,
Channels
:
ChannelStack
,
Settings
:
SettingStack
,
Deposit
,
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment