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
7ba58952
Commit
7ba58952
authored
Jun 28, 2017
by
dev0tion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add startWith to polling
parent
88671d48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
api.service.ts
Breeze.UI/src/app/shared/services/api.service.ts
+4
-1
dashboard.component.ts
Breeze.UI/src/app/wallet/dashboard/dashboard.component.ts
+0
-1
No files found.
Breeze.UI/src/app/shared/services/api.service.ts
View file @
7ba58952
...
...
@@ -5,6 +5,7 @@ import 'rxjs/add/operator/map';
import
'rxjs/add/operator/switchMap'
;
import
'rxjs/add/operator/catch'
;
import
"rxjs/add/observable/interval"
;
import
'rxjs/add/operator/startWith'
;
import
{
WalletCreation
}
from
'../classes/wallet-creation'
;
import
{
WalletRecovery
}
from
'../classes/wallet-recovery'
;
...
...
@@ -24,7 +25,7 @@ export class ApiService {
private
mockApiUrl
=
'http://localhost:3000/api'
;
private
webApiUrl
=
'http://localhost:5000/api'
;
private
headers
=
new
Headers
({
'Content-Type'
:
'application/json'
});
private
pollingInterval
=
2
000
;
private
pollingInterval
=
3
000
;
/**
* Gets available wallets at the default path
...
...
@@ -80,6 +81,7 @@ export class ApiService {
return
Observable
.
interval
(
this
.
pollingInterval
)
.
startWith
(
0
)
.
switchMap
(()
=>
this
.
http
.
get
(
this
.
webApiUrl
+
'/wallet/balance'
,
new
RequestOptions
({
headers
:
this
.
headers
,
search
:
params
})))
.
map
((
response
:
Response
)
=>
response
);
...
...
@@ -97,6 +99,7 @@ export class ApiService {
return
Observable
.
interval
(
this
.
pollingInterval
)
.
startWith
(
0
)
.
switchMap
(()
=>
this
.
http
.
get
(
this
.
webApiUrl
+
'/wallet/history'
,
new
RequestOptions
({
headers
:
this
.
headers
,
search
:
params
})))
.
map
((
response
:
Response
)
=>
response
);
...
...
Breeze.UI/src/app/wallet/dashboard/dashboard.component.ts
View file @
7ba58952
...
...
@@ -48,7 +48,6 @@ export class DashboardComponent {
private
getWalletBalance
()
{
let
walletInfo
=
new
WalletInfo
(
this
.
globalService
.
getWalletName
(),
this
.
globalService
.
getCoinType
())
this
.
walletBalanceSubscription
=
this
.
apiService
.
getWalletBalance
(
walletInfo
)
.
first
()
.
subscribe
(
response
=>
{
if
(
response
.
status
>=
200
&&
response
.
status
<
400
)
{
...
...
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