I am using snippet settings in my Salesforce chat from Community. The logic in snippet settings is the same as provided over Salesforce developer guide : https://developer.salesforce.com/docs/atlas.en-us.snapins_web_dev.meta/snapins_web_dev/snapins_web_snippet_settings_file.htm
When the chat is initiated for the first time, the logic written in the snippet settings doesn't executes, but when it is initiated for the 2nd time in the same session, it runs perfectly fine.
If there had been something wrong with the code it must not have run the second time as well. Any suggestions?