After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 760100 - Closing OSM Account dialog without logging in should cancel editing
Closing OSM Account dialog without logging in should cancel editing
Status: RESOLVED FIXED
Product: gnome-maps
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-maps-maint
gnome-maps-maint
Depends on:
Blocks:
 
 
Reported: 2016-01-03 18:34 UTC by Alex Anthony
Modified: 2016-01-04 08:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Cancel editing if OSM Account dialog closes without logging in (1.23 KB, patch)
2016-01-03 18:43 UTC, Alex Anthony
committed Details | Review

Description Alex Anthony 2016-01-03 18:34:22 UTC
To reproduce:
Start off not logged into OSM
Right click on the map -> What's here?
Edit button
The account dialog opens
Hit the account dialog close button without logging in

Actual outcome:
Advance to the editing window

Expected outcome:
Return to the map



In placeBubble.js:
if (!response === OSMAccountDialog.Response.SIGNED_IN)
   return;

this compares !response (false) to OSMAccountDialog.Response.SIGNED_IN (0) so doesn't return.

Patch replaces this with:
if (response !== OSMAccountDialog.Response.SIGNED_IN)
   return;
Comment 1 Alex Anthony 2016-01-03 18:43:16 UTC
Created attachment 318187 [details] [review]
Cancel editing if OSM Account dialog closes without logging in

The response of the OSM Account dialog isn't being handled correctly, so the edit window opens

!response is being compared with ===, rather than response being compared using !==. !response is false, not a number.

Change (!response === OSMAccountDialog.Response.SIGNED_IN) to (response !== OSMAccountDialog.Response.SIGNED_IN)
Comment 2 Jonas Danielsson 2016-01-04 08:48:18 UTC
Review of attachment 318187 [details] [review]:

Thanks a lot for this fix!

I will commit this with some changes to the commit message.
If you want to see what GNOME feels is a nice commit message, read this:
https://wiki.gnome.org/Git/CommitMessages

Thanks again!