{"action":"created","comment":{"url":"https://api.github.com/repos/codeforamerica/wand/pulls/comments/36583435","id":36583435,"diff_hunk":"@@ -23,18 +23,32 @@ var Wand = (function(wand) {\n     if (nodeId !== wand.state.getCurrentNode()) {\n       _state.push(nodeId);\n       history.pushState(\n-        wand.state.getState(), '', addUrlParam(document.location.search, \"wandState\", encodeState(wand.state.getState()))\n+        wand.state.getState(), '',\n+        addUrlParam(document.location.search, \"wandState\", encodeState(wand.state.getState()))\n       );\n     }\n   };\n \n   function getStateFromUrl() {\n+    var nodeId;\n     var _loadState = decodeState(getParameterByName('wandState'));\n+    _state = _loadState;\n+\n     if (_loadState === '') {\n-      return Wand.opts.nodes[0].id;\n+      resetState();\n+      nodeId = Wand.opts.nodes[0].id;\n+    } else if (!wand.util.getNodeObject(wand.state.getCurrentNode())) {\n+      wand.notifications.add({\n+        text: 'Invalid wand state. Directing you to the beginning instead.',\n+        time: 3500,\n+        type: 'warning'\n+      });\n+      resetState();\n+      nodeId = Wand.opts.nodes[0].id;\n+    } else {\n+      nodeId = wand.state.getCurrentNode();\n     }\n-    _state = _loadState;\n-    return wand.state.getCurrentNode();\n+    return nodeId;\n   }\n \n   function resetState() {","path":"src/js/state.js","position":36,"original_position":36,"commit_id":"f50ac050a88be6aef5b93dd8bd90cc4b6c772c02","original_commit_id":"f50ac050a88be6aef5b93dd8bd90cc4b6c772c02","user":{"login":"bsmithgall","id":1957344,"avatar_url":"https://avatars.githubusercontent.com/u/1957344?v=3","gravatar_id":"","url":"https://api.github.com/users/bsmithgall","html_url":"https://github.com/bsmithgall","followers_url":"https://api.github.com/users/bsmithgall/followers","following_url":"https://api.github.com/users/bsmithgall/following{/other_user}","gists_url":"https://api.github.com/users/bsmithgall/gists{/gist_id}","starred_url":"https://api.github.com/users/bsmithgall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsmithgall/subscriptions","organizations_url":"https://api.github.com/users/bsmithgall/orgs","repos_url":"https://api.github.com/users/bsmithgall/repos","events_url":"https://api.github.com/users/bsmithgall/events{/privacy}","received_events_url":"https://api.github.com/users/bsmithgall/received_events","type":"User","site_admin":false},"body":"I don't think for now, but there might be some use for it later. If you need it to do work on #43 then sure.","created_at":"2015-08-09T01:24:10Z","updated_at":"2015-08-09T01:24:10Z","html_url":"https://github.com/codeforamerica/wand/pull/45#discussion_r36583435","pull_request_url":"https://api.github.com/repos/codeforamerica/wand/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/codeforamerica/wand/pulls/comments/36583435"},"html":{"href":"https://github.com/codeforamerica/wand/pull/45#discussion_r36583435"},"pull_request":{"href":"https://api.github.com/repos/codeforamerica/wand/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/codeforamerica/wand/pulls/45","id":41963092,"html_url":"https://github.com/codeforamerica/wand/pull/45","diff_url":"https://github.com/codeforamerica/wand/pull/45.diff","patch_url":"https://github.com/codeforamerica/wand/pull/45.patch","issue_url":"https://api.github.com/repos/codeforamerica/wand/issues/45","number":45,"state":"open","locked":false,"title":"Notifications","user":{"login":"bsmithgall","id":1957344,"avatar_url":"https://avatars.githubusercontent.com/u/1957344?v=3","gravatar_id":"","url":"https://api.github.com/users/bsmithgall","html_url":"https://github.com/bsmithgall","followers_url":"https://api.github.com/users/bsmithgall/followers","following_url":"https://api.github.com/users/bsmithgall/following{/other_user}","gists_url":"https://api.github.com/users/bsmithgall/gists{/gist_id}","starred_url":"https://api.github.com/users/bsmithgall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsmithgall/subscriptions","organizations_url":"https://api.github.com/users/bsmithgall/orgs","repos_url":"https://api.github.com/users/bsmithgall/repos","events_url":"https://api.github.com/users/bsmithgall/events{/privacy}","received_events_url":"https://api.github.com/users/bsmithgall/received_events","type":"User","site_admin":false},"body":"### What Changed\r\n+ Added notifications\r\n+ Fixed minor bugs with state, invalid engine rendering\r\n\r\n### Issues\r\n+ Halfway done with #33 \r\n\r\n### Screenshot\r\n![image](https://cloud.githubusercontent.com/assets/1957344/9152932/e2182e10-3df2-11e5-8a7a-42a6a0233401.png)\r\n","created_at":"2015-08-09T00:28:32Z","updated_at":"2015-08-09T01:24:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee2b3fb3cb11d884cf95fbf891437f4d62aca0b3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codeforamerica/wand/pulls/45/commits","review_comments_url":"https://api.github.com/repos/codeforamerica/wand/pulls/45/comments","review_comment_url":"https://api.github.com/repos/codeforamerica/wand/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codeforamerica/wand/issues/45/comments","statuses_url":"https://api.github.com/repos/codeforamerica/wand/statuses/f50ac050a88be6aef5b93dd8bd90cc4b6c772c02","head":{"label":"codeforamerica:notifications","ref":"notifications","sha":"f50ac050a88be6aef5b93dd8bd90cc4b6c772c02","user":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"repo":{"id":38065208,"name":"wand","full_name":"codeforamerica/wand","owner":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codeforamerica/wand","description":"Let's make wizards!","fork":false,"url":"https://api.github.com/repos/codeforamerica/wand","forks_url":"https://api.github.com/repos/codeforamerica/wand/forks","keys_url":"https://api.github.com/repos/codeforamerica/wand/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeforamerica/wand/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeforamerica/wand/teams","hooks_url":"https://api.github.com/repos/codeforamerica/wand/hooks","issue_events_url":"https://api.github.com/repos/codeforamerica/wand/issues/events{/number}","events_url":"https://api.github.com/repos/codeforamerica/wand/events","assignees_url":"https://api.github.com/repos/codeforamerica/wand/assignees{/user}","branches_url":"https://api.github.com/repos/codeforamerica/wand/branches{/branch}","tags_url":"https://api.github.com/repos/codeforamerica/wand/tags","blobs_url":"https://api.github.com/repos/codeforamerica/wand/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeforamerica/wand/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeforamerica/wand/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeforamerica/wand/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeforamerica/wand/statuses/{sha}","languages_url":"https://api.github.com/repos/codeforamerica/wand/languages","stargazers_url":"https://api.github.com/repos/codeforamerica/wand/stargazers","contributors_url":"https://api.github.com/repos/codeforamerica/wand/contributors","subscribers_url":"https://api.github.com/repos/codeforamerica/wand/subscribers","subscription_url":"https://api.github.com/repos/codeforamerica/wand/subscription","commits_url":"https://api.github.com/repos/codeforamerica/wand/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeforamerica/wand/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeforamerica/wand/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeforamerica/wand/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeforamerica/wand/contents/{+path}","compare_url":"https://api.github.com/repos/codeforamerica/wand/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeforamerica/wand/merges","archive_url":"https://api.github.com/repos/codeforamerica/wand/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeforamerica/wand/downloads","issues_url":"https://api.github.com/repos/codeforamerica/wand/issues{/number}","pulls_url":"https://api.github.com/repos/codeforamerica/wand/pulls{/number}","milestones_url":"https://api.github.com/repos/codeforamerica/wand/milestones{/number}","notifications_url":"https://api.github.com/repos/codeforamerica/wand/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeforamerica/wand/labels{/name}","releases_url":"https://api.github.com/repos/codeforamerica/wand/releases{/id}","created_at":"2015-06-25T18:00:45Z","updated_at":"2015-07-30T18:39:05Z","pushed_at":"2015-08-09T00:28:32Z","git_url":"git://github.com/codeforamerica/wand.git","ssh_url":"git@github.com:codeforamerica/wand.git","clone_url":"https://github.com/codeforamerica/wand.git","svn_url":"https://github.com/codeforamerica/wand","homepage":null,"size":615,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":16,"forks":1,"open_issues":16,"watchers":3,"default_branch":"master"}},"base":{"label":"codeforamerica:api-trigger-experiment","ref":"api-trigger-experiment","sha":"e35a5416320826a31833ea1265dc040ea79374bb","user":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"repo":{"id":38065208,"name":"wand","full_name":"codeforamerica/wand","owner":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codeforamerica/wand","description":"Let's make wizards!","fork":false,"url":"https://api.github.com/repos/codeforamerica/wand","forks_url":"https://api.github.com/repos/codeforamerica/wand/forks","keys_url":"https://api.github.com/repos/codeforamerica/wand/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeforamerica/wand/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeforamerica/wand/teams","hooks_url":"https://api.github.com/repos/codeforamerica/wand/hooks","issue_events_url":"https://api.github.com/repos/codeforamerica/wand/issues/events{/number}","events_url":"https://api.github.com/repos/codeforamerica/wand/events","assignees_url":"https://api.github.com/repos/codeforamerica/wand/assignees{/user}","branches_url":"https://api.github.com/repos/codeforamerica/wand/branches{/branch}","tags_url":"https://api.github.com/repos/codeforamerica/wand/tags","blobs_url":"https://api.github.com/repos/codeforamerica/wand/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeforamerica/wand/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeforamerica/wand/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeforamerica/wand/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeforamerica/wand/statuses/{sha}","languages_url":"https://api.github.com/repos/codeforamerica/wand/languages","stargazers_url":"https://api.github.com/repos/codeforamerica/wand/stargazers","contributors_url":"https://api.github.com/repos/codeforamerica/wand/contributors","subscribers_url":"https://api.github.com/repos/codeforamerica/wand/subscribers","subscription_url":"https://api.github.com/repos/codeforamerica/wand/subscription","commits_url":"https://api.github.com/repos/codeforamerica/wand/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeforamerica/wand/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeforamerica/wand/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeforamerica/wand/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeforamerica/wand/contents/{+path}","compare_url":"https://api.github.com/repos/codeforamerica/wand/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeforamerica/wand/merges","archive_url":"https://api.github.com/repos/codeforamerica/wand/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeforamerica/wand/downloads","issues_url":"https://api.github.com/repos/codeforamerica/wand/issues{/number}","pulls_url":"https://api.github.com/repos/codeforamerica/wand/pulls{/number}","milestones_url":"https://api.github.com/repos/codeforamerica/wand/milestones{/number}","notifications_url":"https://api.github.com/repos/codeforamerica/wand/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeforamerica/wand/labels{/name}","releases_url":"https://api.github.com/repos/codeforamerica/wand/releases{/id}","created_at":"2015-06-25T18:00:45Z","updated_at":"2015-07-30T18:39:05Z","pushed_at":"2015-08-09T00:28:32Z","git_url":"git://github.com/codeforamerica/wand.git","ssh_url":"git@github.com:codeforamerica/wand.git","clone_url":"https://github.com/codeforamerica/wand.git","svn_url":"https://github.com/codeforamerica/wand","homepage":null,"size":615,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":16,"forks":1,"open_issues":16,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codeforamerica/wand/pulls/45"},"html":{"href":"https://github.com/codeforamerica/wand/pull/45"},"issue":{"href":"https://api.github.com/repos/codeforamerica/wand/issues/45"},"comments":{"href":"https://api.github.com/repos/codeforamerica/wand/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/codeforamerica/wand/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/codeforamerica/wand/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codeforamerica/wand/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/codeforamerica/wand/statuses/f50ac050a88be6aef5b93dd8bd90cc4b6c772c02"}}}}