heylinda / heylinda-app

The open source and free meditation app alternative for everyone. Built with React Native and Expo.
https://heylinda.netlify.app
GNU Affero General Public License v3.0
672 stars 164 forks source link

[Bug] - Manually submitting sessions doesn't update the stats properly #106

Closed EmersonPinheiro closed 3 years ago

EmersonPinheiro commented 3 years ago

Before reporting:

Steps to reproduce:

Scenario 1

  1. Go to the Stats screen.
  2. Select a day to manually insert minutes session.
  3. Submit 65 minutes.

Expected behaviour: The 'Listened' stat should show '65 minutes' (or 1 hour and 5 minutes).

Actual behaviour: 'Listened' stat shows 5 minutes.

Scenario 2

  1. Go to the Stats screen.
  2. Select and submit 10 minutes on 6 different days.

Expected behaviour: The 'Listened' stat should show '60 minutes' (or 1 hour).

Actual behaviour: 'Listened' stat shows 0 minutes.

Smartphone (please complete the following information):

Screenshots/Recording:

Scenario 1 image image

watadarkstar commented 3 years ago

@EmersonPinheiro It seems like any value after 60 minutes has this bug

simulator_screenshot_4FD4F133-8E80-4B49-B9EE-C6A3A1B2D396 :

That may give you a clue on how to solve this bug or someone

EmersonPinheiro commented 3 years ago

Cool. I can work on this. :)

EmersonPinheiro commented 3 years ago

Which one of the following approaches do you like more for showing the stats to the user?

1

image image image image

2

image image image

watadarkstar commented 3 years ago

@EmersonPinheiro The 1st one is good but make sure to put a space between 1h and 30m so its 1h 30m. And if it isn't passed an hour ideally have it say 30 minutes with the full word. And same thing if its exactly a multiple of 1 hour have it say 1 hour or 2 hours

You should write some unit tests for this function that does this if you know how / or want to learn how