{"action":"created","comment":{"url":"https://api.github.com/repos/mobify/astro-scaffold/pulls/comments/80185984","id":80185984,"diff_hunk":"@@ -90,14 +92,28 @@ function(\n         var self = this;\n         params = Astro.Utils.extend({forced: false}, params);\n \n-        self._secureStore.get('onboarded').then(function(onboarded) {\n-            if (onboarded !== 'YES' || params.forced) {\n-                self.isShowing = true;\n-                self.modalView.show({animated: true});\n-                AppEvents.trigger(AppEvents.names.welcomeShown);\n-                self._secureStore.set('onboarded', 'YES');\n+        return Promise.join(\n+            Application.getAppInformation(),\n+            self._secureStore.get('installationID'),\n+            function(appInfo, previousInstallationID) {\n+                // Welcome modal should be triggered when installationID changes\n+                // NOTE: appInfo.installationID appears to be different on each app run\n+                // on the iOS Simulator, but on real devices they will persist.\n+                if (appInfo.installationID !== previousInstallationID || params.forced) {\n+                    return new Promise(function(resolve, reject) {\n+                        self.isShowing = true;\n+                        self.modalView.show({animated: true});\n+\n+                        // Promise will be resolved when welcome modal is dismissed\n+                        AppEvents.on(AppEvents.names.welcomeHidden, function() {\n+                            self._secureStore.set('installationID', appInfo.installationID);\n+                            resolve();","path":"app/app-controllers/welcome-screen/welcomeModalController.js","position":41,"original_position":41,"commit_id":"b63fcffcda185d793b0c1d26791ff83bb3d74572","original_commit_id":"b63fcffcda185d793b0c1d26791ff83bb3d74572","user":{"login":"tony-dinh","id":10932540,"avatar_url":"https://avatars.githubusercontent.com/u/10932540?v=3","gravatar_id":"","url":"https://api.github.com/users/tony-dinh","html_url":"https://github.com/tony-dinh","followers_url":"https://api.github.com/users/tony-dinh/followers","following_url":"https://api.github.com/users/tony-dinh/following{/other_user}","gists_url":"https://api.github.com/users/tony-dinh/gists{/gist_id}","starred_url":"https://api.github.com/users/tony-dinh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tony-dinh/subscriptions","organizations_url":"https://api.github.com/users/tony-dinh/orgs","repos_url":"https://api.github.com/users/tony-dinh/repos","events_url":"https://api.github.com/users/tony-dinh/events{/privacy}","received_events_url":"https://api.github.com/users/tony-dinh/received_events","type":"User","site_admin":false},"body":"Hmm... I feel like I had a conversation with someone before and remembered talking about how the `callback` provided to `Promise.join` would resolve once it hits a return or when it executes to the end of a code path in its scope.\r\n\r\nSo here the return a `Promise` would be where it resolves whereas if we don't show it... the `callback ` would finish and would `resolve` automatically.\r\n\r\nI could definitely make it more explicit in the code though... since it does seem like the promise never resolves.","created_at":"2016-09-23T06:04:03Z","updated_at":"2016-09-23T06:04:03Z","html_url":"https://github.com/mobify/astro-scaffold/pull/123#discussion_r80185984","pull_request_url":"https://api.github.com/repos/mobify/astro-scaffold/pulls/123","_links":{"self":{"href":"https://api.github.com/repos/mobify/astro-scaffold/pulls/comments/80185984"},"html":{"href":"https://github.com/mobify/astro-scaffold/pull/123#discussion_r80185984"},"pull_request":{"href":"https://api.github.com/repos/mobify/astro-scaffold/pulls/123"}}},"pull_request":{"url":"https://api.github.com/repos/mobify/astro-scaffold/pulls/123","id":85653015,"html_url":"https://github.com/mobify/astro-scaffold/pull/123","diff_url":"https://github.com/mobify/astro-scaffold/pull/123.diff","patch_url":"https://github.com/mobify/astro-scaffold/pull/123.patch","issue_url":"https://api.github.com/repos/mobify/astro-scaffold/issues/123","number":123,"state":"open","locked":false,"title":"Refactor Welcome Flow","user":{"login":"tony-dinh","id":10932540,"avatar_url":"https://avatars.githubusercontent.com/u/10932540?v=3","gravatar_id":"","url":"https://api.github.com/users/tony-dinh","html_url":"https://github.com/tony-dinh","followers_url":"https://api.github.com/users/tony-dinh/followers","following_url":"https://api.github.com/users/tony-dinh/following{/other_user}","gists_url":"https://api.github.com/users/tony-dinh/gists{/gist_id}","starred_url":"https://api.github.com/users/tony-dinh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tony-dinh/subscriptions","organizations_url":"https://api.github.com/users/tony-dinh/orgs","repos_url":"https://api.github.com/users/tony-dinh/repos","events_url":"https://api.github.com/users/tony-dinh/events{/privacy}","received_events_url":"https://api.github.com/users/tony-dinh/received_events","type":"User","site_admin":false},"body":"The current implementation for our welcome flow has some UI drawbacks. When we load the welcome modal & main app layout simultaneously, we can see content being loaded before the welcome modal reveals itself.\r\n\r\nOur existing app projects (RBA/ eXtra/ Burlington) have implemented a different welcome flow and since its a recurring theme, we should probably bake it into the Scaffold :).\r\n\r\nThis PR refactors the flow slightly so that we have the following state flow:\r\n`show welcome --> welcome complete --> hide welcome --> instantiate/load main app content `\r\n\r\nSome benefits of this:\r\n- We won't have to worry about alerts (such as location permission) coming from content loading behind the scenes, while the welcome modal is up\r\n- Less stress on the device on load, and since we want the welcome modal to show up ASAP and perform well, this is good :)\r\n- No visual display of main app layout loading before the welcome modal shows up... (cause it isn't)\r\n\r\nJIRA: **None**\r\nLinked PRs: **None**\r\n\r\n## Changes\r\n- Rely on installationID to determine whether to show the welcome modal\r\n- Refactor flow to the one described above ☝️\r\n\r\n## How to test-drive this PR\r\n- Make sure app still functions ;)\r\n\r\n**iOS & Android**\r\n    1. Launch the app (layout shouldn't matter)\r\n    2. Notice that you won't see the main app content before the welcome modal shows\r\n    3. Dismiss the welcome modal\r\n    4. Notice that the app content should load have loaded after dismissal\r\n\r\n## TODOS:\r\n- [x] Change works in both Android and iOS.\r\n- [x] CHANGELOG.md has been updated.\r\n- [x] Run the generator to make sure it still functions correctly.\r\n- [ ] +1 from an engineer on the Astro team.\r\n- [x] Both tab layout and drawer layout are fully functional in ios. (Set `useTabLayout` in `baseConfig`)\r\n\r\n","created_at":"2016-09-16T23:18:15Z","updated_at":"2016-09-23T06:04:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"433118c0e7d0bded69eaa595ac2e64bcba067706","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mobify/astro-scaffold/pulls/123/commits","review_comments_url":"https://api.github.com/repos/mobify/astro-scaffold/pulls/123/comments","review_comment_url":"https://api.github.com/repos/mobify/astro-scaffold/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mobify/astro-scaffold/issues/123/comments","statuses_url":"https://api.github.com/repos/mobify/astro-scaffold/statuses/b63fcffcda185d793b0c1d26791ff83bb3d74572","head":{"label":"mobify:refactor-welcome-flow","ref":"refactor-welcome-flow","sha":"b63fcffcda185d793b0c1d26791ff83bb3d74572","user":{"login":"mobify","id":73539,"avatar_url":"https://avatars.githubusercontent.com/u/73539?v=3","gravatar_id":"","url":"https://api.github.com/users/mobify","html_url":"https://github.com/mobify","followers_url":"https://api.github.com/users/mobify/followers","following_url":"https://api.github.com/users/mobify/following{/other_user}","gists_url":"https://api.github.com/users/mobify/gists{/gist_id}","starred_url":"https://api.github.com/users/mobify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobify/subscriptions","organizations_url":"https://api.github.com/users/mobify/orgs","repos_url":"https://api.github.com/users/mobify/repos","events_url":"https://api.github.com/users/mobify/events{/privacy}","received_events_url":"https://api.github.com/users/mobify/received_events","type":"Organization","site_admin":false},"repo":{"id":34024647,"name":"astro-scaffold","full_name":"mobify/astro-scaffold","owner":{"login":"mobify","id":73539,"avatar_url":"https://avatars.githubusercontent.com/u/73539?v=3","gravatar_id":"","url":"https://api.github.com/users/mobify","html_url":"https://github.com/mobify","followers_url":"https://api.github.com/users/mobify/followers","following_url":"https://api.github.com/users/mobify/following{/other_user}","gists_url":"https://api.github.com/users/mobify/gists{/gist_id}","starred_url":"https://api.github.com/users/mobify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobify/subscriptions","organizations_url":"https://api.github.com/users/mobify/orgs","repos_url":"https://api.github.com/users/mobify/repos","events_url":"https://api.github.com/users/mobify/events{/privacy}","received_events_url":"https://api.github.com/users/mobify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mobify/astro-scaffold","description":"🏗 Starting point for building Astro applications!","fork":false,"url":"https://api.github.com/repos/mobify/astro-scaffold","forks_url":"https://api.github.com/repos/mobify/astro-scaffold/forks","keys_url":"https://api.github.com/repos/mobify/astro-scaffold/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mobify/astro-scaffold/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mobify/astro-scaffold/teams","hooks_url":"https://api.github.com/repos/mobify/astro-scaffold/hooks","issue_events_url":"https://api.github.com/repos/mobify/astro-scaffold/issues/events{/number}","events_url":"https://api.github.com/repos/mobify/astro-scaffold/events","assignees_url":"https://api.github.com/repos/mobify/astro-scaffold/assignees{/user}","branches_url":"https://api.github.com/repos/mobify/astro-scaffold/branches{/branch}","tags_url":"https://api.github.com/repos/mobify/astro-scaffold/tags","blobs_url":"https://api.github.com/repos/mobify/astro-scaffold/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mobify/astro-scaffold/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mobify/astro-scaffold/git/refs{/sha}","trees_url":"https://api.github.com/repos/mobify/astro-scaffold/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mobify/astro-scaffold/statuses/{sha}","languages_url":"https://api.github.com/repos/mobify/astro-scaffold/languages","stargazers_url":"https://api.github.com/repos/mobify/astro-scaffold/stargazers","contributors_url":"https://api.github.com/repos/mobify/astro-scaffold/contributors","subscribers_url":"https://api.github.com/repos/mobify/astro-scaffold/subscribers","subscription_url":"https://api.github.com/repos/mobify/astro-scaffold/subscription","commits_url":"https://api.github.com/repos/mobify/astro-scaffold/commits{/sha}","git_commits_url":"https://api.github.com/repos/mobify/astro-scaffold/git/commits{/sha}","comments_url":"https://api.github.com/repos/mobify/astro-scaffold/comments{/number}","issue_comment_url":"https://api.github.com/repos/mobify/astro-scaffold/issues/comments{/number}","contents_url":"https://api.github.com/repos/mobify/astro-scaffold/contents/{+path}","compare_url":"https://api.github.com/repos/mobify/astro-scaffold/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mobify/astro-scaffold/merges","archive_url":"https://api.github.com/repos/mobify/astro-scaffold/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mobify/astro-scaffold/downloads","issues_url":"https://api.github.com/repos/mobify/astro-scaffold/issues{/number}","pulls_url":"https://api.github.com/repos/mobify/astro-scaffold/pulls{/number}","milestones_url":"https://api.github.com/repos/mobify/astro-scaffold/milestones{/number}","notifications_url":"https://api.github.com/repos/mobify/astro-scaffold/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mobify/astro-scaffold/labels{/name}","releases_url":"https://api.github.com/repos/mobify/astro-scaffold/releases{/id}","deployments_url":"https://api.github.com/repos/mobify/astro-scaffold/deployments","created_at":"2015-04-15T23:56:36Z","updated_at":"2016-08-25T08:50:11Z","pushed_at":"2016-09-22T22:38:18Z","git_url":"git://github.com/mobify/astro-scaffold.git","ssh_url":"git@github.com:mobify/astro-scaffold.git","clone_url":"https://github.com/mobify/astro-scaffold.git","svn_url":"https://github.com/mobify/astro-scaffold","homepage":"http://astro.mobify.com/","size":1136,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":3,"default_branch":"develop"}},"base":{"label":"mobify:develop","ref":"develop","sha":"df8962d0b339289dc7061daba96f653e15c302f4","user":{"login":"mobify","id":73539,"avatar_url":"https://avatars.githubusercontent.com/u/73539?v=3","gravatar_id":"","url":"https://api.github.com/users/mobify","html_url":"https://github.com/mobify","followers_url":"https://api.github.com/users/mobify/followers","following_url":"https://api.github.com/users/mobify/following{/other_user}","gists_url":"https://api.github.com/users/mobify/gists{/gist_id}","starred_url":"https://api.github.com/users/mobify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobify/subscriptions","organizations_url":"https://api.github.com/users/mobify/orgs","repos_url":"https://api.github.com/users/mobify/repos","events_url":"https://api.github.com/users/mobify/events{/privacy}","received_events_url":"https://api.github.com/users/mobify/received_events","type":"Organization","site_admin":false},"repo":{"id":34024647,"name":"astro-scaffold","full_name":"mobify/astro-scaffold","owner":{"login":"mobify","id":73539,"avatar_url":"https://avatars.githubusercontent.com/u/73539?v=3","gravatar_id":"","url":"https://api.github.com/users/mobify","html_url":"https://github.com/mobify","followers_url":"https://api.github.com/users/mobify/followers","following_url":"https://api.github.com/users/mobify/following{/other_user}","gists_url":"https://api.github.com/users/mobify/gists{/gist_id}","starred_url":"https://api.github.com/users/mobify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobify/subscriptions","organizations_url":"https://api.github.com/users/mobify/orgs","repos_url":"https://api.github.com/users/mobify/repos","events_url":"https://api.github.com/users/mobify/events{/privacy}","received_events_url":"https://api.github.com/users/mobify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mobify/astro-scaffold","description":"🏗 Starting point for building Astro applications!","fork":false,"url":"https://api.github.com/repos/mobify/astro-scaffold","forks_url":"https://api.github.com/repos/mobify/astro-scaffold/forks","keys_url":"https://api.github.com/repos/mobify/astro-scaffold/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mobify/astro-scaffold/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mobify/astro-scaffold/teams","hooks_url":"https://api.github.com/repos/mobify/astro-scaffold/hooks","issue_events_url":"https://api.github.com/repos/mobify/astro-scaffold/issues/events{/number}","events_url":"https://api.github.com/repos/mobify/astro-scaffold/events","assignees_url":"https://api.github.com/repos/mobify/astro-scaffold/assignees{/user}","branches_url":"https://api.github.com/repos/mobify/astro-scaffold/branches{/branch}","tags_url":"https://api.github.com/repos/mobify/astro-scaffold/tags","blobs_url":"https://api.github.com/repos/mobify/astro-scaffold/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mobify/astro-scaffold/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mobify/astro-scaffold/git/refs{/sha}","trees_url":"https://api.github.com/repos/mobify/astro-scaffold/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mobify/astro-scaffold/statuses/{sha}","languages_url":"https://api.github.com/repos/mobify/astro-scaffold/languages","stargazers_url":"https://api.github.com/repos/mobify/astro-scaffold/stargazers","contributors_url":"https://api.github.com/repos/mobify/astro-scaffold/contributors","subscribers_url":"https://api.github.com/repos/mobify/astro-scaffold/subscribers","subscription_url":"https://api.github.com/repos/mobify/astro-scaffold/subscription","commits_url":"https://api.github.com/repos/mobify/astro-scaffold/commits{/sha}","git_commits_url":"https://api.github.com/repos/mobify/astro-scaffold/git/commits{/sha}","comments_url":"https://api.github.com/repos/mobify/astro-scaffold/comments{/number}","issue_comment_url":"https://api.github.com/repos/mobify/astro-scaffold/issues/comments{/number}","contents_url":"https://api.github.com/repos/mobify/astro-scaffold/contents/{+path}","compare_url":"https://api.github.com/repos/mobify/astro-scaffold/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mobify/astro-scaffold/merges","archive_url":"https://api.github.com/repos/mobify/astro-scaffold/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mobify/astro-scaffold/downloads","issues_url":"https://api.github.com/repos/mobify/astro-scaffold/issues{/number}","pulls_url":"https://api.github.com/repos/mobify/astro-scaffold/pulls{/number}","milestones_url":"https://api.github.com/repos/mobify/astro-scaffold/milestones{/number}","notifications_url":"https://api.github.com/repos/mobify/astro-scaffold/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mobify/astro-scaffold/labels{/name}","releases_url":"https://api.github.com/repos/mobify/astro-scaffold/releases{/id}","deployments_url":"https://api.github.com/repos/mobify/astro-scaffold/deployments","created_at":"2015-04-15T23:56:36Z","updated_at":"2016-08-25T08:50:11Z","pushed_at":"2016-09-22T22:38:18Z","git_url":"git://github.com/mobify/astro-scaffold.git","ssh_url":"git@github.com:mobify/astro-scaffold.git","clone_url":"https://github.com/mobify/astro-scaffold.git","svn_url":"https://github.com/mobify/astro-scaffold","homepage":"http://astro.mobify.com/","size":1136,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":3,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mobify/astro-scaffold/pulls/123"},"html":{"href":"https://github.com/mobify/astro-scaffold/pull/123"},"issue":{"href":"https://api.github.com/repos/mobify/astro-scaffold/issues/123"},"comments":{"href":"https://api.github.com/repos/mobify/astro-scaffold/issues/123/comments"},"review_comments":{"href":"https://api.github.com/repos/mobify/astro-scaffold/pulls/123/comments"},"review_comment":{"href":"https://api.github.com/repos/mobify/astro-scaffold/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mobify/astro-scaffold/pulls/123/commits"},"statuses":{"href":"https://api.github.com/repos/mobify/astro-scaffold/statuses/b63fcffcda185d793b0c1d26791ff83bb3d74572"}}}}
{"actor":{"display_login":"tony-dinh"}}