Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
F
fether
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
20
Issues
20
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
parity
fether
Commits
9263ec47
Commit
9263ec47
authored
Jul 03, 2018
by
Amaury Martiny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more debug messages
parent
d3b9dbc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
packages/fether-react/src/stores/createAccountStore.js
packages/fether-react/src/stores/createAccountStore.js
+5
-0
packages/fether-react/src/stores/parityStore.js
packages/fether-react/src/stores/parityStore.js
+7
-4
No files found.
packages/fether-react/src/stores/createAccountStore.js
View file @
9263ec47
...
...
@@ -5,8 +5,11 @@
import
{
action
,
observable
}
from
'
mobx
'
;
import
Debug
from
'
../utils/debug
'
;
import
parityStore
from
'
./parityStore
'
;
const
debug
=
Debug
(
'
createAccountStore
'
);
export
class
CreateAccountStore
{
@
observable
address
=
null
;
@
observable
isImport
=
false
;
// Are we creating a new account, or importing via phrase?
...
...
@@ -22,10 +25,12 @@ export class CreateAccountStore {
}
generateNewAccount
=
()
=>
{
debug
(
'
Generating new account.
'
);
return
parityStore
.
api
.
parity
.
generateSecretPhrase
().
then
(
this
.
setPhrase
);
};
saveAccountToParity
=
password
=>
{
debug
(
'
Saving account to Parity.
'
);
return
parityStore
.
api
.
parity
.
newAccountFromPhrase
(
this
.
phrase
,
password
)
.
then
(()
=>
...
...
packages/fether-react/src/stores/parityStore.js
View file @
9263ec47
...
...
@@ -12,7 +12,7 @@ import store from 'store';
import
Debug
from
'
../utils/debug
'
;
import
LS_PREFIX
from
'
./utils/lsPrefix
'
;
const
debug
=
Debug
(
'
send
Store
'
);
const
debug
=
Debug
(
'
parity
Store
'
);
const
electron
=
isElectron
()
?
window
.
require
(
'
electron
'
)
:
null
;
const
LS_KEY
=
`
${
LS_PREFIX
}
::secureToken`
;
...
...
@@ -64,6 +64,7 @@ export class ParityStore {
defaultPort
}
`
;
}
debug
(
`Connecting to
${
provider
}
.`
);
const
api
=
new
Api
(
new
Api
.
Provider
.
Ws
(
provider
,
...
...
@@ -78,8 +79,8 @@ export class ParityStore {
this
.
api
=
api
;
// TODO This is not working
// api.on('connected', () =>
...
);
// api.on('disconnected', () =>
...
);
// api.on('connected', () =>
this.setIsApiConnected(true)
);
// api.on('disconnected', () =>
this.setIsApiConnected(false)
);
// So instead, we poll every 1s
setInterval
(()
=>
{
this
.
setIsApiConnected
(
api
.
isConnected
);
...
...
@@ -90,6 +91,7 @@ export class ParityStore {
const
{
ipcRenderer
}
=
electron
;
// Request new token from Electron
debug
(
'
Requesting new token.
'
);
ipcRenderer
.
send
(
'
asynchronous-message
'
,
'
signer-new-token
'
);
ipcRenderer
.
once
(
'
asynchronous-reply
'
,
(
_
,
token
)
=>
{
if
(
!
token
)
{
...
...
@@ -111,7 +113,7 @@ export class ParityStore {
if
(
isApiConnected
===
this
.
isApiConnected
)
{
return
;
}
debug
(
`Api is now
${
isApiConnected
?
'
connected
'
:
'
disconnected
'
}
.`
);
this
.
isApiConnected
=
isApiConnected
;
};
...
...
@@ -135,6 +137,7 @@ export class ParityStore {
return
;
}
debug
(
`Setting token in localStorage.`
);
this
.
token
=
token
;
// If we receive a new token, then we try to connect to the Api with this
...
...
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