mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-05-06 14:46:20 -04:00
* 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
26 lines
450 B
JavaScript
26 lines
450 B
JavaScript
// @flow
|
|
|
|
import inatjs from "inaturalistjs";
|
|
import Taxon from "realmModels/Taxon";
|
|
|
|
import handleError from "./error";
|
|
|
|
const PARAMS = {
|
|
fields: {
|
|
taxon: Taxon.TAXON_FIELDS
|
|
}
|
|
};
|
|
|
|
const scoreImage = async (
|
|
params: Object = {},
|
|
opts: Object = {}
|
|
): Promise<any> => {
|
|
try {
|
|
return inatjs.computervision.score_image( { ...PARAMS, ...params }, opts );
|
|
} catch ( e ) {
|
|
return handleError( e );
|
|
}
|
|
};
|
|
|
|
export default scoreImage;
|