Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
3cc77262
Commit
3cc77262
authored
8 years ago
by
dev0tion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Navigate with status message
parent
76cb8163
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
21 deletions
+15
-21
app.component.ts
Breeze.UI/src/app/app.component.ts
+15
-21
No files found.
Breeze.UI/src/app/app.component.ts
View file @
3cc77262
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Router
}
from
'@angular/router'
;
import
{
remote
}
from
'electron'
;
import
{
ApiService
}
from
'./shared/api/api.service'
;
@
Component
({
...
...
@@ -13,9 +11,8 @@ import { ApiService } from './shared/api/api.service';
export
class
AppComponent
implements
OnInit
{
constructor
(
private
router
:
Router
,
private
apiService
:
ApiService
)
{}
private
errorMessage
:
string
;
private
response
:
any
;
private
isConfigured
:
boolean
=
true
;
private
errorMessage
:
any
;
private
responseMessage
:
any
;
ngOnInit
()
{
this
.
checkWalletStatus
();
...
...
@@ -24,22 +21,19 @@ export class AppComponent implements OnInit {
private
checkWalletStatus
(){
this
.
apiService
.
getWalletStatus
()
.
subscribe
(
response
=>
this
.
response
=
response
,
error
=>
this
.
errorMessage
=
<
any
>
error
,
()
=>
this
.
navigate
()
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
responseMessage
=
response
;
this
.
router
.
navigate
([
'/login'
]);
}
},
error
=>
{
this
.
errorMessage
=
<
any
>
error
;
if
(
error
.
status
===
400
||
error
.
status
===
404
)
{
this
.
router
.
navigate
([
'/setup'
]);
console
.
log
(
this
.
errorMessage
);
}
}
);
}
private
navigate
()
{
if
(
this
.
response
.
success
===
"true"
)
{
// remote.dialog.showMessageBox({message: remote.app.getPath('userData')})
this
.
router
.
navigate
([
'/login'
])
}
else
{
this
.
router
.
navigate
([
'/setup'
])
}
}
private
hasWallet
()
{
return
true
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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