[gnome-maps] routeQuery: Require all filled points for valid
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] routeQuery: Require all filled points for valid
- Date: Wed, 9 Oct 2019 19:56:05 +0000 (UTC)
commit 6a7e0b07fa9bde6e2e369db3929381f3233be200
Author: Marcus Lundblad <ml update uu se>
Date: Wed Oct 9 21:43:58 2019 +0200
routeQuery: Require all filled points for valid
Only consider query as valid if all points are filled.
This avoids a case where adding a new destination using
the context menu results in two requests being executed,
first one with the previous places and immediatly one
with the new point set to a place. This results in
unnessesary API calls and a glitchy UX.
Fixes #224
src/routeQuery.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/routeQuery.js b/src/routeQuery.js
index 2fbedf0..060015d 100644
--- a/src/routeQuery.js
+++ b/src/routeQuery.js
@@ -239,7 +239,8 @@ var RouteQuery = GObject.registerClass({
}
isValid() {
- if (this.filledPoints.length >= 2)
+ if (this.filledPoints.length >= 2 &&
+ this.filledPoints.length === this.points.length)
return true;
else
return false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]