-
Notifications
You must be signed in to change notification settings - Fork 103
feat: Improve ExpirationTimePicker component
#7782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Improve ExpirationTimePicker component
#7782
Conversation
packages/desktop/components/popups/send/SendConfirmationPopup.svelte
brancoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of moving parts in the ExpirationTimePicker:
- Toggling
giftStoragDepositButton - Setting Date to expiration time picker initially and also when returning from unlock stronghold popup
- be cautious to not
rebuildTransactionOutputif not intended by changing expiration date
In regards to this part of the issue:
There is some "remember previous value" logic in the component that causes bugs. Case found by Branko in the Refactor send flow PR (#7608)
In the original code this can be fix with this change to the setNull function:
export function setNull(bool: boolean): void {
if (bool && value) {
storedValue = value
value = null
previouslySelectedPeriod = selectedTimePeriod
selectedTimePeriod = TimePeriod.None
} else {
value = storedValue ?? value
selectedTimePeriod = previouslySelectedPeriod
}
}
setNull was used when toggling giftStorageDeposit button but it wasn't tracking and resetting all the variables correctly.
packages/desktop/components/popups/send/SendConfirmationPopup.svelte
Outdated
Show resolved
Hide resolved
brancoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted changes and added a fix for "remember previous value" from this issue #7710
LGTM! |
cpl121
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
Partialy resolves the issue #7710, mainly this part:
We can open a new issue for expiration timepicker improvement because it would be a big refactor
Close #7710
...
Changelog
Testing
Platforms
Instructions
...
Checklist