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
22317159
Unverified
Commit
22317159
authored
May 07, 2019
by
Tankred Hase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement reset to block navigating back from home
parent
f39cb66f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
index-mobile.js
src/action/index-mobile.js
+2
-2
nav-mobile.js
src/action/nav-mobile.js
+12
-3
main-mobile.js
src/view/main-mobile.js
+1
-1
No files found.
src/action/index-mobile.js
View file @
22317159
...
...
@@ -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 @
22317159
...
...
@@ -5,14 +5,22 @@
*/
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
}));
navigatorRef
.
dispatch
(
this
.
_navActions
.
navigate
({
routeName
,
params
}));
this
.
_reset
=
(
routeName
,
params
)
=>
navigatorRef
.
dispatch
(
this
.
_stackActions
.
reset
({
index
:
0
,
actions
:
[
this
.
_navActions
.
navigate
({
routeName
,
params
})],
})
);
this
.
_store
.
navReady
=
true
;
}
...
...
@@ -78,6 +86,7 @@ class NavAction {
goHome
()
{
this
.
_navigate
(
'Home'
);
this
.
_reset
(
'Home'
);
}
goPay
()
{
...
...
src/view/main-mobile.js
View file @
22317159
...
...
@@ -193,7 +193,6 @@ const MainStack = createStackNavigator(
NewAddress
,
Password
,
LoaderSyncing
,
Home
,
Settings
,
SettingsUnit
,
SettingsFiat
,
...
...
@@ -245,6 +244,7 @@ const ChannelStack = createStackNavigator(
const
RootStack
=
createStackNavigator
(
{
Home
,
Main
:
MainStack
,
Invoice
:
InvoiceStack
,
Pay
:
PayStack
,
...
...
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