Mithil467 / mitype

Typing speed test in terminal
http://mithil467.github.io/mitype
GNU General Public License v3.0
415 stars 62 forks source link

Test records not saved in history #118

Closed Dark-Knight11 closed 3 years ago

Dark-Knight11 commented 3 years ago

Subject of the issue

All test records are not being saved into history. If you give one test for a specific text sample and after finishing it you press TAB to retry again then the new retried test won't be saved into history only the first attempt is being saved. Similarly, if you change the text with left and right arrow keys then that new test with new text is also not being saved. Only the first test after running the tool is being saved.

Your environment

Steps to reproduce

  1. Run mitype and give the test.
  2. Press TAB to retry or change the text with left and right arrow keys.
  3. Retry the same sample or attempt the new test with selected new text.
  4. Exit mitype with ESC
  5. Check history mitype -H
  6. Check that only first test was saved into history, test at 3rd point isn't saved.

Expected behaviour

All test records should be saved

Actual behaviour

Only the first attempted test after running the tool is being saved

Your proposed fix (if any)

Not sure what's the problem but I believe it lies in this code somewhere https://github.com/Mithil467/mitype/blob/052df91c8b309819ef8702d26c4fe679cfb16a01/mitype/app.py#L288-L347

BhandarkarPawan commented 3 years ago

@Dark-Knight11 I think found the bug. Can I work on this? (+hacktoberfest label)

Mithil467 commented 3 years ago

Thanks for the issue! @Dark-Knight11

Mithil467 commented 3 years ago

That's awesome! @BhandarkarPawan Make sure to read the contributing guidelines before getting started :)

BhandarkarPawan commented 3 years ago

@Mithil467 The fix was just a one-line addition. I have made a PR. Can you please check if it is OK?