forked from MapComplete/MapComplete
More work
This commit is contained in:
parent
06f8cf7006
commit
b1ea986515
2 changed files with 13 additions and 5 deletions
|
@ -25,15 +25,16 @@ export default class PlantNetSpeciesSearch extends VariableUiElement {
|
|||
if (images.length === 0) {
|
||||
return null
|
||||
}
|
||||
return new UIEventSource({success: PlantNet.exampleResultPrunus}) /*/ UIEventSource.FromPromiseWithErr(PlantNet.query(images.slice(0,5))); //*/
|
||||
return UIEventSource.FromPromiseWithErr(PlantNet.query(images.slice(0,5)));
|
||||
})
|
||||
.map(result => {
|
||||
if (result === null) {
|
||||
return t.takeImages
|
||||
}
|
||||
if (result === undefined) {
|
||||
return new Loading(t.querying.Subs(images.data))
|
||||
}
|
||||
if (result === null) {
|
||||
return t.takeImages
|
||||
}
|
||||
|
||||
if (result["error"] !== undefined) {
|
||||
return t.error.Subs(<any>result).SetClass("alert")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue