Commit Graph

614 Commits

Author SHA1 Message Date
Brandon Presley 49b5eb48c6 Refactor MassiveSnack
Instead of using a context for the whole app
use DeviceEventEmitter with root state.
This will probably improve performance,
since I think the react context was
re-rendering the entire DOM tree.
2022-11-01 15:55:37 +13:00
Brandon Presley ace327ecad Remove vestiges of react-native-sqlite-storage 2022-11-01 12:30:31 +13:00
Brandon Presley f56f0063c4 Turn off some eslint rules 2022-11-01 12:30:06 +13:00
Brandon Presley 3c4bba3f85 Fix infinite refreshing on first load of StartPlan 2022-11-01 12:29:54 +13:00
Brandon Presley 1a53fa324b Remove redundant Color context
Settings already stores the color set by the user.
2022-10-31 21:32:33 +13:00
Brandon Presley 13ca9cef3e Reword "maximum" as "target" for sets
There isn't any restriction involved in the sets
for each workout, it's more like a guide.
2022-10-31 21:00:53 +13:00
Brandon Presley bdb27894f7 Optimize root context 2022-10-31 21:00:10 +13:00
Brandon Presley b782d66bf2 Fix adding new set from homepage 2022-10-31 20:59:40 +13:00
Brandon Presley 09ee09f509 Ran prettier on __tests__ 2022-10-31 20:58:51 +13:00
Brandon Presley bd6b20fb4e Add migration to drop old migrations table 2022-10-31 18:16:19 +13:00
Brandon Presley eafad1f47e Simplify migrations in App.tsx 2022-10-31 18:16:11 +13:00
Brandon Presley bc7aca03e8 Remove semicolons from line endings 2022-10-31 17:22:08 +13:00
Brandon Presley 1bc145f60c Allow failure of migrations
Since we are swapping from the old system to this system
sometimes the columns will be already existing.
These errors failing are OK since we haven't changed
any column types before.
2022-10-31 17:21:28 +13:00
Brandon Presley e7321b6d8e Add typeorm migrations 2022-10-31 17:05:31 +13:00
Brandon Presley b7f1c2192e Pause converting to typeorm due to odd error
ERROR  TypeError: Cannot read property 'getItem' of undefined

This error is located at:
    in FlatList (created by SetList)
    in RCTView (created by View)
    in View (created by Page)
    in Page (created by SetList)
    in SetList (created by SceneView)
...

I found an open issue on the react-native github which seems
related https://github.com/facebook/react-native/issues/31523
but after following all of their suggestions I still have the
same error. I tried:
- Removing @babel/plugin-proposal-class-properties & @babel/plugin-transform-flow-strip-types
- Adding @babel/plugin-transform-flow-strip-types
2022-10-31 13:20:36 +13:00
Brandon Presley 111ee4201f Set versionCode=36079 2022-10-30 15:44:19 +13:00
Brandon Presley 294c6ee639 Send yarn lint & test to background 2022-10-30 15:43:27 +13:00
Brandon Presley 8ad6189dfc Fix colors on header bar for light theme 2022-10-30 15:42:43 +13:00
Brandon Presley 9752aa9dd1 Set versionCode=36078 2022-10-30 15:35:31 +13:00
Brandon Presley e0da621198 Add undo feature to StartPlan 2022-10-30 15:34:17 +13:00
Brandon Presley e33ff1172a Factor out StartPlanItem 2022-10-30 15:23:22 +13:00
Brandon Presley 992b3d0ba6 Fix unit sometimes exporting as the string 'null' 2022-10-30 15:14:57 +13:00
Brandon Presley 2ae9d2a4c1 Improve performance of StartPlan 2022-10-30 14:46:32 +13:00
Brandon Presley eba33c2599 Revert "Revert "Optimize query in StartPlan""
This reverts commit 129b00dc5d.
2022-10-30 14:27:22 +13:00
Brandon Presley a804d9ef05 Set versionCode=36077 2022-10-30 14:09:51 +13:00
Brandon Presley 5fafc6a63a Fix plan starting 2022-10-30 14:08:41 +13:00
Brandon Presley a85bc04c35 Set versionCode=36076 2022-10-30 13:49:10 +13:00
Brandon Presley 129b00dc5d Revert "Optimize query in StartPlan"
This reverts commit 97827c68b2.
2022-10-30 13:42:20 +13:00
Brandon Presley ba2a2259f3 Set versionCode=36075 2022-10-30 13:16:41 +13:00
Brandon Presley e1a90a98fb Fix crashing of plans 2022-10-30 13:15:31 +13:00
Brandon Presley 8a240b78cd Set versionCode=36074 2022-10-30 12:59:02 +13:00
Brandon Presley 6e75614d10 Add basic working unit tests 2022-10-30 12:56:58 +13:00
Brandon Presley cc97c760bb Give up trying to add unit tests
Running tests gives the following error:
TypeError: _reactNative.BackHandler.addEventListener is not a function
2022-10-29 17:16:28 +13:00
Brandon Presley 4aa62dace8 Set versionCode=36073 2022-10-28 19:05:07 +13:00
Brandon Presley 3784285695 Fix short day format 2022-10-28 19:04:05 +13:00
Brandon Presley 5a22c73834 Set versionCode=36072 2022-10-28 19:01:08 +13:00
Brandon Presley 463852e6a6 Prevent double searching everywhere
Also change variable names. Search should represent the
act of searching, rather than the value being typed by the user.
2022-10-28 18:59:54 +13:00
Brandon Presley 3d591f4618 Prevent searching twice on homepage first load 2022-10-28 18:41:17 +13:00
Brandon Presley e6dcd4a47e Use hermes engine
https://reactnative.dev/docs/hermes
2022-10-28 18:36:47 +13:00
Brandon Presley afbdd2fed5 Upgrade all packages 2022-10-28 16:26:03 +13:00
Brandon Presley 82888ce530 Set versionCode=36071 2022-10-28 15:50:26 +13:00
Brandon Presley ac0af26f77 Add more date format options
Closes #94
2022-10-28 15:49:03 +13:00
Brandon Presley 6d6a6f7a20 Set versionCode=36070 2022-10-27 17:35:52 +13:00
Brandon Presley 859fa2a89f Add setting to disable sound on rest timers
Closes #50
2022-10-27 17:28:27 +13:00
Brandon Presley ef7342b788 Fix max sets always being 3 for plans 2022-10-27 10:32:40 +13:00
Brandon Presley 4735b1589b Fix selection for plan starting
Old selection index was based on `workouts`
new one is based on the `counts`.
2022-10-27 10:07:02 +13:00
Brandon Presley 4e6de66f90 Fix query for start plan
If the WHERE IN query is in the first select,
then we will have no results unless the person
has already worked out today.
2022-10-27 10:01:30 +13:00
Brandon Presley cd602cee33 Cast plan description to string
If it's a number, then zero doesn't display
probably because the library is checking for
truthy.
2022-10-27 10:00:47 +13:00
Brandon Presley 97827c68b2 Optimize query in StartPlan
Closes #98
2022-10-26 18:31:40 +13:00
Brandon Presley 3be82e0b36 Default unit on volume labels to kg
Closes #100
2022-10-26 18:04:33 +13:00