-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add Liquidity Rewards notifications #2272
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add notification that will inform the user about the new LP tokens that were transferred to his wallet.
Add Liquidity Reward Earned notification, which is displayed every 7 minutes (if user's rewards balance got up since last time).
Set a violet diamon icon for Liquidity Reward Earned notification.
Set notification interval to true in redux store for each liquidity pair when we start the intervals.
Add 'View your balance" link to liquidity reward earned notification. Remove margin-bottom from the notification.
Save the last notification reward amount before initializing the interval.
Rename showMessage->displayMessage
r-czajkowski
requested changes
Jan 20, 2021
Also, let's sync with the current |
Merged
Handle notification checking on the redux saga side.
Assign the UI Component for banners based on message type.
Check if user is logged in before fetching LiquidityRewards data.
Update luquidity reward amount after showing the rewards earned notification.
Update wrappedTokenBalance amount after wrapped token mint transaction.
Set displayMessage initial value inside watchLiquidityRewardNotifications funcion to false to make sure that the first iteration of the Liquidity Reward Notification check will update the lastNotificationRewardAmount variable in redux without showing the message.
@r-czajkowski Ready for another round of code review |
r-czajkowski
requested changes
Feb 9, 2021
Change the hardcoded number to momentjs' miliseconds when checking the notifications every 7 minutes.
Refactor processLiquidityRewardEarnedNotification function and get rid of unnecessary chunks of code.
Refactor notifications to make them scale better as the app grows.
Adds a proper condition to make sure that the notification that informs the user about LP tokens transferred to his wallet is not displayed.
After the Transfer event was emitted we would update the `wrappedTokenBalance` which caused a bug when user wanted to add more lp tokens after withdraw. It was cause becaused we updated the 'wrappedTokenBalance' twice - first we fetched it on `Transfer` event and the we add the value to the current state value in redux.
Ready for another round of review |
Change the event from rewardClaimedEventName to depositWithdrawnEventName when checking the events emitted during lp tokens trasfer to a user's wallet
LP token notification was not displayed if user (after connecting to a wallet) did not go to the Liquidity page. I fixed it with extracting the subscribtion of `observeWrappedTokenMintAndBurnTx` to a separate saga function.
Move `observableWrappedTokenMintAndBurnTx` subscribtion back to `subscribeToLiquidityRewardsEvent` but no the beginning, so we get rid of the unnecessary for loop.
r-czajkowski
requested changes
Feb 16, 2021
solidity/dashboard/src/components/messages/LiquidityRewardsEarnedMessage.jsx
Outdated
Show resolved
Hide resolved
r-czajkowski
requested changes
Feb 16, 2021
solidity/dashboard/src/components/messages/LPTokensInWalletMessage.jsx
Outdated
Show resolved
Hide resolved
Change the hierarchy of <Router> component in App.js - move it higher so we can use <Link> components in <Messages>.
r-czajkowski
approved these changes
Feb 16, 2021
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds two new notifications: