Problem Description
Here's the thing i tried to do - start a layout - set localstorage value - close and back again or refresh the page - check if item exist and set text to its value and if it's value equals to 1 do something.
Attach a Capx
I don't know why, but i can't attach it, i don't have attachements button. Here's the link.
https://yadi.sk/d/bQ9xA43Kfz969
Description of Capx
Text object + Sprite object + Touch object. On start of layout check if item "Value" exist, if exist set text to item's value and if item's value equals 1 - rotate sprite 34 degrees clockwise. On first start the localstorage "Value" item is not exist, so you need to touch the sprite to Set "Value" item to 1 and restart the layout. On restart you'll see that text is now showing 1 (items value) and sprite is rotated, you can tap sprite again and again to restart the layout and see that everything is working as it should, everytime the layout restarts "Value" item sets to text and compares right. Now refresh the page (F5, browsers refresh) or close and start the preview again, local storage triggers the exist condition but gives us the empty value, so text is empty text, and it is not equals 1 anymore and the sprite is not rotated because of that.
Steps to Reproduce Bug
- Start preview
- Touch the Sprite to Set "Value" item to 1 and restart the layout
- On restart you'll see that text is now showing 1 and sprite is rotated, as it should
- Now refresh the page (F5, browsers refresh) or close and start the preview again, the result must be the same as after restart of layout but it's not, local storage triggers the exist condition but gives us the empty value, and value of item "Value" is not equals 1 anymore
Observed Result
Local storage triggers the exist condition but gives us the empty value
Expected Result
Local storage always gives me the values that i stored.
Affected Browsers
- Chrome: (YES)
- FireFox: (YES)
- Internet Explorer: (YES)
Operating System and Service Pack
Windows 7 64bit latest all.
Construct 2 Version ID
r202