feat: show feedback when map search yields no results

This commit is contained in:
Thea Schöbl
2022-03-17 09:25:05 +01:00
committed by Rainer Killinger
parent 488150f7f5
commit c54ea867bd

View File

@@ -249,6 +249,15 @@ export class MapPageComponent {
this.filterQuery,
this.queryText,
);
if (result.data.length === 0) {
const alert = await this.alertController.create({
buttons: [this.translateService.instant('ok')],
header: this.translateService.instant('map.page.NO_RESULTS'),
});
await alert.present();
return;
}
// override items with results
this.items = result.data as SCPlace[];
this.addToMap(result.data as Array<SCBuilding | SCRoom>, true, animate);