Photobrowser dynamic index problem

Hi ,
I’m using v5.4.2 when I’m using dynamic photo then open photo browser from index 0 the image is blank but If I do not put photo index it display as normal.

$$('.view-img').on('click', function () {
  photoIndex = $$(this).attr('data-index');
  var myPhotoBrowserStandalone = app.photoBrowser.create({
    photos: photosViewTmp,
    theme: 'dark'
  });
  if (photoIndex == 0) {
    myPhotoBrowserStandalone.open();
  } else {
    myPhotoBrowserStandalone.open(photoIndex);
  }
});

because of
myPhotoBrowserStandalone.open(photoIndex);
is not same as
myPhotoBrowserStandalone.open(0);

maybe bcs photoIndex its a string?
so:

photoIndex = parseInt($$(this).attr('data-index'))

also:

0 == "0" =>  true
0 === "0" => false

You are right :slight_smile: