Have you tried checking the console output? It’s hard to say without more code, but it could be that one of them opens in one iteration, and the other opens in another. The for loop is quick so it could look like it’s happening at the same time.
Try changing it to this and see what happens:
function matchString() {
for(var i=0;i<imei.count;i++)
if(imei.get(i).imeistring === deviceInfo.imei ) {
console.log("Iteration: " + i + ", true");
dialogone.open();
}
else {
console.log("Iteration: " + i + ", false");
dialogtwo.open()
}
}
↧