[Steem Curator] - User Preference Settings

in utopian-io •  6 years ago  (edited)

Repository:

https://github.com/mightypanda-x/steem-curator

Production URL:

https://steemcurator.com/

Introduction Posts

https://busy.org/@mightypanda/steem-curator-mvp-comments-curation
https://busy.org/@mightypanda/steem-curator-easies-curation-and-tech-debt
https://busy.org/@mightypanda/steem-curator-sorting-feature-and-utopian-posts

New Feature and associated pull request

My main objective with steem curator is to ease the process of finding and curating great posts. One thing that constantly bothered me while curating posts was that I kept forgetting which posts I have already voted on. This new feature addresses this specific use case. Now you can add your username in the settings page and your preferred steem front end. Once this information is set, it will get stored in local storage and retrieved on every site visit. This information is then used to show posts that have already been voted on and can be opened in your preferred frontend. This improves the process of curation by a great extent.

Pull Request: https://github.com/mightypanda-x/steem-curator/pull/7

A walk through the code

saveProfileSettings effect intercepts an action to save settings and saves these settings to local storage. This code then proceeds to the reducer to update the state with the information just saved in the memory.

loadProfileSettings effect intercepts an action to load settings from memory and update the state object.
image.png

This is the actual logic to save and load data from local storage.
image.png

This method creates the object to be saved and dispatches the save action with the object payload.
image.png

ngOnInit method dispatches a load call as soon as the application is loaded to get data from storage and load it in redux store
image.png

Selector to get utopian posts
image.png

This is the piece of code where all the magic happens. It takes in all the available data and adds information of voting and author
image.png
2018-09-11_18-39-56.gif
Github: https://github.com/mightypanda-x

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Because of the steem blockchain issues, this post was missed from the upvote queue of utopian and now it is past voting time threshold. After discussing with @amosbastian, I am created this comment so utopian can upvote this comment on the post instead of the post itself for the reward.

Thanks @mightypanda for your contribution. Due to an issue with the Steem blockchain which prevented the vote to be casted in time, this comment has been upvoted instead.

Thank you for your contribution. A nice update to the project. Few thoughts -

  1. +1 for adding the tests.
  2. It's better not to hardcode username
  3. +1 for using ES6 features.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thanks for the review. I cant find username hardcoding. Can you point me to that.

Its line number 18 of src/app/utopian/reducers/utopian.reducers.ts

Got it. That was in the first commit when i hadn't built the load feature. It was removed in next commit.

Ok cool, I might have missed that :)

Thank you for your review, @codingdefined!

So far this week you've reviewed 1 contributions. Keep up the good work!

Congratulations @mightypanda! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

SteemitBoard - Witness Update

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by mightyPanda from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

Hi @mightypanda!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server