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
9938d6a2
Commit
9938d6a2
authored
Aug 07, 2018
by
Paul Herbert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved serialDisposable to shared
parent
9eb2fe56
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
21 deletions
+19
-21
serialDisposable.ts
Breeze.UI/src/app/shared/classes/serialDisposable.ts
+0
-0
advanced.component.ts
Breeze.UI/src/app/wallet/advanced/advanced.component.ts
+19
-21
No files found.
Breeze.UI/src/app/
wallet/advanced
/serialDisposable.ts
→
Breeze.UI/src/app/
shared/classes
/serialDisposable.ts
View file @
9938d6a2
File moved
Breeze.UI/src/app/wallet/advanced/advanced.component.ts
View file @
9938d6a2
import
{
Component
,
OnInit
,
OnDestroy
}
from
'@angular/core'
;
import
{
FormGroup
,
Validators
,
FormBuilder
,
AbstractControl
}
from
'@angular/forms'
;
import
{
NgbDateStruct
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
'rxjs/add/operator/filter'
;
import
'./monitor'
;
import
{
AdvancedService
}
from
'./advanced.service'
;
import
{
LoadingState
}
from
'./loadingState'
;
import
{
SerialDisposable
}
from
'./serialDisposable'
;
import
{
SerialDisposable
}
from
'.
./../../app/shared/classes
/serialDisposable'
;
@
Component
({
selector
:
'app-advanced'
,
...
...
@@ -20,23 +21,23 @@ export class AdvancedComponent implements OnInit, OnDestroy {
private
addresses
:
string
[]
=
[];
private
resyncActioned
=
false
;
constructor
(
private
advancedService
:
AdvancedService
,
private
formBuilder
:
FormBuilder
)
{
constructor
(
readonly
advancedService
:
AdvancedService
,
readonly
formBuilder
:
FormBuilder
)
{
this
.
setResyncDates
();
}
public
icoFormGroup
:
FormGroup
;
public
extPubKey
=
''
;
public
resyncDate
:
NgbDateStruct
;
public
extPubKeyLoadingState
=
new
LoadingState
();
public
generateAddresses
LoadingState
=
new
LoadingState
();
public
resyncLoadingState
=
new
LoadingState
()
;
public
maxResyncDate
:
NgbDateStruct
;
public
minResyncDate
:
NgbDateStruct
;
public
get
datePickerControl
():
AbstractControl
{
return
this
.
icoFormGroup
.
get
(
'datePickerControl'
);
}
public
get
addressCountControl
():
AbstractControl
{
return
this
.
icoFormGroup
.
get
(
'addressCountControl'
);
}
public
get
showAddressesTick
():
boolean
{
return
this
.
generateAddressesLoadingState
.
success
&&
icoFormGroup
:
FormGroup
;
extPubKey
=
''
;
extPubKeyLoadingState
=
new
LoadingState
();
generateAddressesLoadingState
=
new
LoadingState
();
resync
LoadingState
=
new
LoadingState
();
resyncDate
:
NgbDateStruct
;
maxResyncDate
:
NgbDateStruct
;
minResyncDate
:
NgbDateStruct
;
get
datePickerControl
():
AbstractControl
{
return
this
.
icoFormGroup
.
get
(
'datePickerControl'
);
}
get
addressCountControl
():
AbstractControl
{
return
this
.
icoFormGroup
.
get
(
'addressCountControl'
);
}
get
showAddressesTick
():
boolean
{
return
this
.
generateAddressesLoadingState
.
success
&&
this
.
addresses
.
length
&&
(
Number
(
this
.
addressCount
)
===
this
.
addresses
.
length
);
}
public
get
showResyncTick
():
boolean
{
return
this
.
resyncLoadingState
.
success
&&
this
.
resyncActioned
;
}
get
showResyncTick
():
boolean
{
return
this
.
resyncLoadingState
.
success
&&
this
.
resyncActioned
;
}
ngOnInit
()
{
this
.
registerFormControls
();
...
...
@@ -70,13 +71,10 @@ export class AdvancedComponent implements OnInit, OnDestroy {
datePickerControl
:
[
Validators
.
required
]
});
this
.
addressCountControl
.
valueChanges
.
subscribe
(
_
=>
{
if
(
this
.
addressCountControl
.
invalid
)
{
this
.
addressCountControl
.
setValue
(
this
.
addressCount
);
}
else
{
this
.
addressCount
=
this
.
addressCountControl
.
value
;
}
});
const
control
=
this
.
addressCountControl
;
const
changes$
=
control
.
valueChanges
;
changes$
.
filter
(
_
=>
control
.
invalid
).
subscribe
(
_
=>
control
.
setValue
(
this
.
addressCount
));
changes$
.
filter
(
_
=>
!
control
.
invalid
).
subscribe
(
_
=>
this
.
addressCount
=
control
.
value
);
}
private
setResyncDates
()
{
...
...
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