Helping fix 1 annoying thing on DTube.

in #utopian-io6 years ago (edited)

I'm writing about and submitting some small changes I made to DTube to fix an issue which was troubling me while using the site. I made this change for myself as the bug was annoying to me.


tl;dr summary

  • Update meteor file so it would run locally
  • Make vote % save to user so stays set after leaving site
  • Make NSFW setting save to user so stays set after leaving site

When browsing DTube I like to set my voting to around 5-10% of voting power. This way I can keep liking as I watch many videos. The problem I found was that when I left the site and came back my voting power was always set to 100%.

This would cause me to vote 100% more often than I should meaning my voting power was too low to vote more videos.

menu.png

I first opened this as issue #9. I then started looking through the code.

The first problem I had was that I couldn't run the program locally. I started talking to @heimindanger on Discord and we were able to figure out (mostly him) that the .meteor/versions file was out of sync with his local version. I ran meteor update && meteor npm update to update and committed as can be seen here.

Once I had it working locally I tried my initial solution which was to save the % value to localhost. After reviewing @heimindanger told me that he already created an object easily save this values called UserSettings. Once I knew that it was just a matter of replacing Session object with UserSettings across several different files.

After doing this for the voting % setting I also found that NSFW setting needed the same change.

PR #11 - Save vote percentage
PR #13 - Save NSFW setting, waiting for merge but same change as accepted PR just a different setting

Thanks for read, I know this isn't a lot of changes to the code but it was an enjoyable experience for me. I think it will make browsing the site a little bit more convenient once the change is live in version 0.8.

Thanks again @heimindanger for walking me through parts of this and @utopian-io for past support on my incremental improvements to random steem apps.

Sort:  

Where did you get the template for this type of article? I need to write a similiar article, but about a task I completed for an utopian-io task.
Cool fix, Javascript: "eww", just kidding :)

Just wrote this one as I went.

Thank you for your contribution. It seems like very small changes to the repository, please try to add more features if you can from the next contributions.

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


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

Hey @kirkins
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.26
TRX 0.11
JST 0.033
BTC 64014.44
ETH 3064.06
USDT 1.00
SBD 3.86