Last active
May 23, 2017 15:17
-
-
Save rohitdatta/5977611dcb69df10a91f797e9b1904dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = {{ data|tojson|safe }}; | |
if (sessionStorage.getItem("data")) { | |
if (Object.keys(data).length > 1) { //if data is valid overwrite current storage | |
sessionStorage.setItem("data", JSON.stringify(data)); | |
} else { //passed in blank data except host_nonce | |
data = JSON.parse(sessionStorage.getItem("data")); | |
} | |
} else { | |
sessionStorage.setItem("data", JSON.stringify(data)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment