Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cesium2s
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Cesium-grp
cesium2s
Commits
e7e9d52a
Commit
e7e9d52a
authored
3 months ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
fix(transfert) Set the from address, when given to the transfert modal
parent
151e2106
No related branches found
No related tags found
No related merge requests found
Pipeline
#39836
waiting for manual action
Stage: build
Stage: package
Stage: release
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/transfer/send/transfer.page.html
+1
-0
1 addition, 0 deletions
src/app/transfer/send/transfer.page.html
src/app/transfer/send/transfer.page.ts
+25
-12
25 additions, 12 deletions
src/app/transfer/send/transfer.page.ts
with
26 additions
and
12 deletions
src/app/transfer/send/transfer.page.html
+
1
−
0
View file @
e7e9d52a
...
@@ -47,6 +47,7 @@
...
@@ -47,6 +47,7 @@
labelPlacement=
"floating"
labelPlacement=
"floating"
readonly
readonly
required
required
tappable
></ion-input>
></ion-input>
<ion-icon
slot=
"end"
name=
"chevron-forward-outline"
></ion-icon>
<ion-icon
slot=
"end"
name=
"chevron-forward-outline"
></ion-icon>
...
...
This diff is collapsed.
Click to expand it.
src/app/transfer/send/transfer.page.ts
+
25
−
12
View file @
e7e9d52a
...
@@ -2,9 +2,9 @@ import { ChangeDetectionStrategy, Component, Input, OnDestroy, OnInit, ViewChild
...
@@ -2,9 +2,9 @@ import { ChangeDetectionStrategy, Component, Input, OnDestroy, OnInit, ViewChild
import
{
AppPage
,
AppPageState
}
from
'
@app/shared/pages/base-page.class
'
;
import
{
AppPage
,
AppPageState
}
from
'
@app/shared/pages/base-page.class
'
;
import
{
Account
,
AccountUtils
}
from
'
@app/account/account.model
'
;
import
{
Account
,
AccountUtils
}
from
'
@app/account/account.model
'
;
import
{
ActionSheetOptions
,
IonModal
,
ModalController
,
Platform
,
PopoverOptions
}
from
'
@ionic/angular
'
;
import
{
ActionSheetOptions
,
IonModal
,
ModalController
,
Platform
,
PopoverOptions
}
from
'
@ionic/angular
'
;
import
{
firstValueFrom
,
mergeMap
,
Observable
,
skip
,
tap
}
from
'
rxjs
'
;
import
{
firstValueFrom
,
merge
,
mergeMap
,
Observable
,
skip
,
switchMap
,
tap
}
from
'
rxjs
'
;
import
{
isNotEmptyArray
,
isNotNilOrBlank
}
from
'
@app/shared/functions
'
;
import
{
isNotEmptyArray
,
isNotNilOrBlank
}
from
'
@app/shared/functions
'
;
import
{
filter
}
from
'
rxjs/operators
'
;
import
{
filter
,
map
}
from
'
rxjs/operators
'
;
import
{
NetworkService
}
from
'
@app/network/network.service
'
;
import
{
NetworkService
}
from
'
@app/network/network.service
'
;
import
{
Currency
}
from
'
@app/currency/currency.model
'
;
import
{
Currency
}
from
'
@app/currency/currency.model
'
;
import
{
NavigationEnd
,
Router
}
from
'
@angular/router
'
;
import
{
NavigationEnd
,
Router
}
from
'
@angular/router
'
;
...
@@ -59,7 +59,7 @@ export class TransferPage extends AppPage<TransferPageState> implements Transfer
...
@@ -59,7 +59,7 @@ export class TransferPage extends AppPage<TransferPageState> implements Transfer
@
Input
()
@
RxStateProperty
()
currency
:
Currency
;
@
Input
()
@
RxStateProperty
()
currency
:
Currency
;
@
Input
()
@
RxStateProperty
()
fee
:
number
;
@
Input
()
@
RxStateProperty
()
fee
:
number
;
@
Input
()
@
RxStateProperty
()
account
:
Account
=
null
;
@
Input
()
@
RxStateProperty
()
account
:
Account
;
@
Input
()
@
RxStateProperty
()
recipient
:
Partial
<
Account
>
;
@
Input
()
@
RxStateProperty
()
recipient
:
Partial
<
Account
>
;
@
Input
()
@
RxStateProperty
()
amount
:
number
;
@
Input
()
@
RxStateProperty
()
amount
:
number
;
...
@@ -115,15 +115,7 @@ export class TransferPage extends AppPage<TransferPageState> implements Transfer
...
@@ -115,15 +115,7 @@ export class TransferPage extends AppPage<TransferPageState> implements Transfer
.
pipe
(
.
pipe
(
tap
((
accounts
)
=>
console
.
debug
(
this
.
_logPrefix
+
'
Accounts loaded:
'
,
accounts
)),
tap
((
accounts
)
=>
console
.
debug
(
this
.
_logPrefix
+
'
Accounts loaded:
'
,
accounts
)),
mergeMap
(
async
(
accounts
)
=>
{
mergeMap
(
async
(
accounts
)
=>
{
// Load account
const
fromAddress
=
this
.
account
?.
address
||
this
.
activatedRoute
.
snapshot
.
paramMap
.
get
(
'
from
'
);
if
(
isNotNilOrBlank
(
fromAddress
))
{
this
.
account
=
await
this
.
accountService
.
getByAddress
(
fromAddress
);
}
// Get default
else
if
(
isNotEmptyArray
(
accounts
))
{
this
.
account
=
await
this
.
accountService
.
getDefault
();
}
// Load recipient
// Load recipient
const
toAddress
=
this
.
recipient
?.
address
||
this
.
activatedRoute
.
snapshot
.
paramMap
.
get
(
'
to
'
);
const
toAddress
=
this
.
recipient
?.
address
||
this
.
activatedRoute
.
snapshot
.
paramMap
.
get
(
'
to
'
);
...
@@ -135,6 +127,27 @@ export class TransferPage extends AppPage<TransferPageState> implements Transfer
...
@@ -135,6 +127,27 @@ export class TransferPage extends AppPage<TransferPageState> implements Transfer
)
)
);
);
this
.
_state
.
connect
(
'
account
'
,
this
.
accounts$
.
pipe
(
switchMap
(
accounts
=>
merge
(
this
.
account$
.
pipe
(
map
(
account
=>
({
accounts
,
fromAddress
:
account
?.
address
}))),
this
.
activatedRoute
.
paramMap
.
pipe
(
map
(
paramMap
=>
({
accounts
,
fromAddress
:
paramMap
.
get
(
'
from
'
)})),
filter
(({
fromAddress
})
=>
isNotNilOrBlank
(
fromAddress
))
)
)),
mergeMap
(
async
({
accounts
,
fromAddress
})
=>
{
// Load account
if
(
isNotNilOrBlank
(
fromAddress
))
{
return
this
.
accountService
.
getByAddress
(
fromAddress
);
}
// Get default
else
if
(
isNotEmptyArray
(
accounts
))
{
return
this
.
accountService
.
getDefault
();
}
return
undefined
;
})
));
this
.
_state
.
connect
(
'
currency
'
,
this
.
networkService
.
currency$
);
this
.
_state
.
connect
(
'
currency
'
,
this
.
networkService
.
currency$
);
this
.
_state
.
connect
(
'
fee
'
,
this
.
currency$
,
(
_
,
currency
)
=>
{
this
.
_state
.
connect
(
'
fee
'
,
this
.
currency$
,
(
_
,
currency
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment