* Add a safeRealmWrite transaction for better logging around writes; code cleanup and realm update
* Add safeRealmWrite to tests and make sure action is called synchronously
* Fix final test
* Only write to realm when useObservationsUpdates data changes; code cleanup
* Code cleanup
* Shows notice when user or obs is opted out of Community Taxon on ObsDetails
(closes#882)
* Unifies mapApiToRealm methods around a single interface
* Ensure that the remote obs used on ObsDetail is normalized to look like a
local obs
* Ensure some tests that use signIn() have isolated Realm instances
* Update current user's obs from ObsDetails (closes#1045)
* Fixed CC0 license display on ObsDetails (was not actually related to
updating the local copy of the obs
* Restored Suggestions navigation tests
* Restored SuggestionsWithSyncedObs.test.js tests
* Mocked vision-camera-plugin-inatvision instead of useOfflineSuggestions
* Removed unnecessarily complex object from navigation params
There were a lot of issues here, but the main ones (I think) were related to
rendering all the navigators and waiting for asynchronous stuff to happen
before proceeding with the test.
* Bugfix: TaxonDetails was crashing if it received a null taxon
* Send lat and lng instead of latitude and longitude to the score_image
endpoint
* Show offline suggestions when you are offline
* Show notice when viewing offline suggestions
* Moved code unique to useOnlineSuggestions into that file
* Ensure we use a medium size image to get suggestions when dealing with
remote URLs
* More logging around React Query retries
* Use default retry logic for useAuthenticatedQuery
* Made a module-resolver shortcut for tests
* Move offline notice above top suggestion; hide when offlines exist but onlines do too
* Add zustand to app
* Begin replacing ObsEditProvider with zustand for global state
* Use store and add tests
* Fix bugs
* Add test to check for deleted photos in StandardCamera
* Make sure evidence is only added to current observation; submit comment with ID on ObsDetail
* Fix ObsEditWithoutProvider tests
* Move store to where it's needed
* Fix tests
* Await evidence being added to obsPhotos from camera
* Add a note about slices to useStore
* Mock INatPaperProvider to remove warnings about wrong icon names in jest; closes#421
* Remove unnecessary paper provider mock
* Add mocked views back to tests
* Rename some functions and variables
* Rename function
* Revert to original timeout for tokens
* Get JWT for a 401 or 403 http errors in the react-query QueryClient retry handler
* Log API error to new logger
* Fetch token on every render in useApiToken hook
* Remove commented code
* Add comment
* Remove useEffect from useApiToken
* Revert "Remove useEffect from useApiToken"
This reverts commit 9cf1e0c0bc.
Also added a signOut test helper... and maybe have introduced some problems
with parallel test execution as a result, as parallel jest runs don't seem to
totally separate with regards to the in-memory realm db. Something to think
about.
* Remove delete option for observations not in realm
* Add mutation for delete observation
* Hide delete option for observations not persisted to realm
* Close kebab menu when item pressed; this allows dialog to respond to first user
press
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Fetch user from server, set locale in realm and change language with i18next
* Added some Spanish translations so I can see localization working
* config QueryClient with `cacheTime: Infinity` to deal with "Jest did not
exit" errors
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>