Ticket Created
over 5 years ago

WERETECH-8118

Sim issue with saveWaypoints

In the sim using 3.1.5, the following sometimes doesn't work.

Toybox.PersistedContent.saveWaypoint(location, {:name => name});

It works fine in the device (a real 1030).

Parents
  • function getMatchingLocations(name, larray) { var bGetLocations = false; if(larray == null) { bGetLocations = true; larray = []; } if (!appbase.hasWaypoints) { return null; } name = name.substring(0, iNameLength); var cit = PersistedContent.getWaypoints(); while (cit != null) { var waypoint = cit.next(); if (waypoint == null) { break; } if(startsWith(waypoint.getName(), name)) { if(bGetLocations) { System.println("aaa: "+waypoint.toString()+" "+waypoint.getName()); larray.add(waypoint); } else { var bNew = true; System.println("bbb: "+waypoint.toString()+" "+waypoint.getName()); for(var index1 = 0; index1 < larray.size(); index1++) { if(waypoint.equals(larray[index1])) { bNew = false; } } if(bNew) { System.println("ccc: "+waypoint.toString()+" "+waypoint.getName()); return waypoint; } } } } if(bGetLocations) { return larray; } return null; }

Comment
  • function getMatchingLocations(name, larray) { var bGetLocations = false; if(larray == null) { bGetLocations = true; larray = []; } if (!appbase.hasWaypoints) { return null; } name = name.substring(0, iNameLength); var cit = PersistedContent.getWaypoints(); while (cit != null) { var waypoint = cit.next(); if (waypoint == null) { break; } if(startsWith(waypoint.getName(), name)) { if(bGetLocations) { System.println("aaa: "+waypoint.toString()+" "+waypoint.getName()); larray.add(waypoint); } else { var bNew = true; System.println("bbb: "+waypoint.toString()+" "+waypoint.getName()); for(var index1 = 0; index1 < larray.size(); index1++) { if(waypoint.equals(larray[index1])) { bNew = false; } } if(bNew) { System.println("ccc: "+waypoint.toString()+" "+waypoint.getName()); return waypoint; } } } } if(bGetLocations) { return larray; } return null; }

Children
No Data