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
9c83482d
Commit
9c83482d
authored
Aug 02, 2018
by
Paul Herbert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2100 - ICO updates: tweaks
parent
5348e6f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
advanced.component.ts
Breeze.UI/src/app/wallet/advanced/advanced.component.ts
+15
-15
No files found.
Breeze.UI/src/app/wallet/advanced/advanced.component.ts
View file @
9c83482d
import
{
Component
,
OnInit
,
OnDestroy
,
Input
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
OnDestroy
}
from
'@angular/core'
;
import
{
Subscription
}
from
'rxJs/Subscription'
;
import
{
Subscription
}
from
'rxJs/Subscription'
;
import
{
FormGroup
,
Validators
,
FormBuilder
}
from
'@angular/forms'
;
import
{
FormGroup
,
Validators
,
FormBuilder
,
AbstractControl
}
from
'@angular/forms'
;
import
{
NgbDateStruct
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
NgbDateStruct
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
AdvancedService
}
from
'./advanced.service'
;
import
{
AdvancedService
}
from
'./advanced.service'
;
...
@@ -12,14 +12,16 @@ import { LoadingState } from './loadingState';
...
@@ -12,14 +12,16 @@ import { LoadingState } from './loadingState';
styleUrls
:
[
'./advanced.component.css'
]
styleUrls
:
[
'./advanced.component.css'
]
})
})
export
class
AdvancedComponent
implements
OnInit
,
OnDestroy
{
export
class
AdvancedComponent
implements
OnInit
,
OnDestroy
{
private
addressCount
:
string
;
private
addressCount
=
""
;
private
extPubKeySubs
:
Subscription
;
private
extPubKeySubs
:
Subscription
;
private
generateAddressesSubs
:
Subscription
;
private
generateAddressesSubs
:
Subscription
;
private
resyncSubs
:
Subscription
;
private
resyncSubs
:
Subscription
;
private
addresses
=
new
Array
<
string
>
();
private
addresses
=
new
Array
<
string
>
();
private
resyncActioned
=
false
;
private
resyncActioned
=
false
;
constructor
(
private
advancedService
:
AdvancedService
,
private
formBuilder
:
FormBuilder
)
{
}
constructor
(
private
advancedService
:
AdvancedService
,
private
formBuilder
:
FormBuilder
)
{
this
.
setResyncDates
();
}
public
icoFormGroup
:
FormGroup
;
public
icoFormGroup
:
FormGroup
;
public
extPubKey
=
""
;
public
extPubKey
=
""
;
...
@@ -29,17 +31,15 @@ export class AdvancedComponent implements OnInit, OnDestroy {
...
@@ -29,17 +31,15 @@ export class AdvancedComponent implements OnInit, OnDestroy {
public
resyncLoadingState
=
new
LoadingState
();
public
resyncLoadingState
=
new
LoadingState
();
public
maxResyncDate
:
NgbDateStruct
;
public
maxResyncDate
:
NgbDateStruct
;
public
minResyncDate
:
NgbDateStruct
;
public
minResyncDate
:
NgbDateStruct
;
public
get
datePickerControl
():
AbstractControl
{
return
this
.
icoFormGroup
.
get
(
'datePickerControl'
);
}
public
get
datePickerControl
()
{
return
this
.
icoFormGroup
.
get
(
'datePickerControl'
);
}
public
get
addressCountControl
():
AbstractControl
{
return
this
.
icoFormGroup
.
get
(
'addressCountControl'
);
}
public
get
addressCountControl
()
{
return
this
.
icoFormGroup
.
get
(
'addressCountControl'
);
}
public
get
showAddressesTick
():
boolean
{
return
this
.
generateAddressesLoadingState
.
success
&&
public
get
showAddressesTick
()
{
return
this
.
generateAddressesLoadingState
.
success
&&
this
.
addresses
.
length
&&
(
Number
(
this
.
addressCount
)
===
this
.
addresses
.
length
);
}
this
.
addresses
.
length
&&
(
Number
(
this
.
addressCount
)
===
this
.
addresses
.
length
);
}
public
get
showResyncTick
():
boolean
{
return
this
.
resyncLoadingState
.
success
&&
this
.
resyncActioned
;
}
public
get
showResyncTick
():
boolean
{
return
this
.
resyncLoadingState
.
success
&&
this
.
resyncActioned
;
}
ngOnInit
()
{
ngOnInit
()
{
this
.
registerFormControls
();
this
.
registerFormControls
();
this
.
loadExtPubKey
();
this
.
loadExtPubKey
();
this
.
setResyncDates
();
}
}
public
generateAddresses
()
{
public
generateAddresses
()
{
...
@@ -64,12 +64,6 @@ export class AdvancedComponent implements OnInit, OnDestroy {
...
@@ -64,12 +64,6 @@ export class AdvancedComponent implements OnInit, OnDestroy {
_
=>
this
.
resyncLoadingState
.
errored
=
true
);
_
=>
this
.
resyncLoadingState
.
errored
=
true
);
}
}
private
setResyncDates
()
{
const
now
=
new
Date
();
this
.
maxResyncDate
=
{
year
:
now
.
getFullYear
(),
month
:
now
.
getMonth
()
+
1
,
day
:
now
.
getDate
()}
this
.
minResyncDate
=
{
year
:
now
.
getFullYear
(),
month
:
1
,
day
:
1
}
}
private
loadExtPubKey
()
{
private
loadExtPubKey
()
{
this
.
extPubKeyLoadingState
.
loading
=
true
;
this
.
extPubKeyLoadingState
.
loading
=
true
;
this
.
extPubKeySubs
=
this
.
advancedService
.
getExtPubKey
()
this
.
extPubKeySubs
=
this
.
advancedService
.
getExtPubKey
()
...
@@ -106,6 +100,12 @@ export class AdvancedComponent implements OnInit, OnDestroy {
...
@@ -106,6 +100,12 @@ export class AdvancedComponent implements OnInit, OnDestroy {
});
});
}
}
private
setResyncDates
()
{
const
now
=
new
Date
();
this
.
maxResyncDate
=
{
year
:
now
.
getFullYear
(),
month
:
now
.
getMonth
()
+
1
,
day
:
now
.
getDate
()}
this
.
minResyncDate
=
{
year
:
now
.
getFullYear
(),
month
:
1
,
day
:
1
}
}
ngOnDestroy
()
{
ngOnDestroy
()
{
if
(
this
.
extPubKeySubs
)
{
if
(
this
.
extPubKeySubs
)
{
this
.
extPubKeySubs
.
unsubscribe
();
this
.
extPubKeySubs
.
unsubscribe
();
...
...
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