{"action":"created","issue":{"url":"https://api.github.com/repos/Shopify/theme-scripts/issues/52","repository_url":"https://api.github.com/repos/Shopify/theme-scripts","labels_url":"https://api.github.com/repos/Shopify/theme-scripts/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/Shopify/theme-scripts/issues/52/comments","events_url":"https://api.github.com/repos/Shopify/theme-scripts/issues/52/events","html_url":"https://github.com/Shopify/theme-scripts/issues/52","id":366538450,"node_id":"MDU6SXNzdWUzNjY1Mzg0NTA=","number":52,"title":"cookiesEnabled not present in cart.js","user":{"login":"isaac-martin","id":8649366,"node_id":"MDQ6VXNlcjg2NDkzNjY=","avatar_url":"https://avatars2.githubusercontent.com/u/8649366?v=4","gravatar_id":"","url":"https://api.github.com/users/isaac-martin","html_url":"https://github.com/isaac-martin","followers_url":"https://api.github.com/users/isaac-martin/followers","following_url":"https://api.github.com/users/isaac-martin/following{/other_user}","gists_url":"https://api.github.com/users/isaac-martin/gists{/gist_id}","starred_url":"https://api.github.com/users/isaac-martin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isaac-martin/subscriptions","organizations_url":"https://api.github.com/users/isaac-martin/orgs","repos_url":"https://api.github.com/users/isaac-martin/repos","events_url":"https://api.github.com/users/isaac-martin/events{/privacy}","received_events_url":"https://api.github.com/users/isaac-martin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-03T21:33:28Z","updated_at":"2018-10-04T06:35:03Z","closed_at":null,"author_association":"NONE","body":"Shopify starter and Slate have a function that looks like the below.\r\n```\r\nimport {cookiesEnabled} from '@shopify/theme-cart';\r\n\r\n// Apply a specific class to the html element for browser support of cookies.\r\nif (cookiesEnabled()) {\r\n  document.documentElement.className = document.documentElement.className.replace('supports-no-cookies', 'supports-cookies');\r\n}\r\n```\r\n\r\nHowever the latest version of theme scripts / cart doesn't have that function cookiesEnabled exporting. This may be related to issue #5 \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Shopify/theme-scripts/issues/comments/426901413","html_url":"https://github.com/Shopify/theme-scripts/issues/52#issuecomment-426901413","issue_url":"https://api.github.com/repos/Shopify/theme-scripts/issues/52","id":426901413,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjkwMTQxMw==","user":{"login":"ogzcoder","id":40001401,"node_id":"MDQ6VXNlcjQwMDAxNDAx","avatar_url":"https://avatars2.githubusercontent.com/u/40001401?v=4","gravatar_id":"","url":"https://api.github.com/users/ogzcoder","html_url":"https://github.com/ogzcoder","followers_url":"https://api.github.com/users/ogzcoder/followers","following_url":"https://api.github.com/users/ogzcoder/following{/other_user}","gists_url":"https://api.github.com/users/ogzcoder/gists{/gist_id}","starred_url":"https://api.github.com/users/ogzcoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogzcoder/subscriptions","organizations_url":"https://api.github.com/users/ogzcoder/orgs","repos_url":"https://api.github.com/users/ogzcoder/repos","events_url":"https://api.github.com/users/ogzcoder/events{/privacy}","received_events_url":"https://api.github.com/users/ogzcoder/received_events","type":"User","site_admin":false},"created_at":"2018-10-04T06:35:03Z","updated_at":"2018-10-04T06:35:03Z","author_association":"NONE","body":"I work around that error using `navigator.cookiesEnabled`\r\nso a simple utility function i put in my own util.js looks like:\r\n\r\n```javascript\r\nexport function cookiesEnabled() {\r\n    return navigator.cookiesEnabled;\r\n}\r\n```\r\n\r\nthen in theme.js I remove the theme-cart import and import my own util.js\r\n\r\n```javascript\r\nimport { cookiesEnabled } from 'util';\r\nif (cookiesEnabled()) {\r\n  document.documentElement.className = document.documentElement.className.replace('supports-no-cookies', 'supports-cookies');\r\n}\r\n```"}}
{"actor":{"display_login":"ogzcoder"}}