{"action":"created","comment":{"url":"https://api.github.com/repos/eyedol/checkin/pulls/comments/217883233","pull_request_review_id":155711730,"id":217883233,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzg4MzIzMw==","diff_hunk":"@@ -26,40 +26,41 @@ import com.addhen.checkin.data.repository.PostDataRepository\n import com.addhen.checkin.util.CoroutineDispatchers\n import com.addhen.checkin.view.base.Resource\n import com.hellofresh.barcodescanner.presentation.view.base.BaseViewModel\n+import kotlinx.coroutines.launch\n+import kotlinx.coroutines.withContext\n import timber.log.Timber\n import javax.inject.Inject\n \n class PostsViewModel @Inject constructor(\n     private val dispatchers: CoroutineDispatchers,\n-    private val postDataRepository: PostDataRepository) : BaseViewModel(), LifecycleObserver {\n+    private val postDataRepository: PostDataRepository\n+) : BaseViewModel(dispatchers), LifecycleObserver {\n \n   val posts = MutableLiveData<Resource<List<PostItemViewModel>>>()\n \n   @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)\n-  fun onResume() {\n-    loadPosts()\n-  }\n-\n   fun onSwipeRefresh() {\n     loadPosts()\n   }\n \n   private fun loadPosts() {\n \n-    launchWithParent(dispatchers.main) {\n+    scope.launch {\n       posts.value = Resource.loading()\n-      try {\n-        onPostLoaded(postDataRepository.getPosts())\n-      } catch (e: Exception) {\n-        onError(e)\n+      var posts = emptyList<Post>()\n+      withContext(dispatchers.computation) {\n+        try {\n+          posts = postDataRepository.getPosts()\n+        } catch (e: Exception) {\n+          onError(e)\n+        }\n       }\n+      onPostLoaded(posts)","path":"app/src/main/java/com/addhen/checkin/view/posts/PostsViewModel.kt","position":43,"original_position":43,"commit_id":"fcc8401e8ce393a98a25f7f436a1f9d3be88c18f","original_commit_id":"fcc8401e8ce393a98a25f7f436a1f9d3be88c18f","user":{"login":"eyedol","id":73175,"node_id":"MDQ6VXNlcjczMTc1","avatar_url":"https://avatars0.githubusercontent.com/u/73175?v=4","gravatar_id":"","url":"https://api.github.com/users/eyedol","html_url":"https://github.com/eyedol","followers_url":"https://api.github.com/users/eyedol/followers","following_url":"https://api.github.com/users/eyedol/following{/other_user}","gists_url":"https://api.github.com/users/eyedol/gists{/gist_id}","starred_url":"https://api.github.com/users/eyedol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyedol/subscriptions","organizations_url":"https://api.github.com/users/eyedol/orgs","repos_url":"https://api.github.com/users/eyedol/repos","events_url":"https://api.github.com/users/eyedol/events{/privacy}","received_events_url":"https://api.github.com/users/eyedol/received_events","type":"User","site_admin":false},"body":"<table data-meta=\"generated_by_danger\">\n  <tbody>\n    <tr>\n      <td>:warning:</td>\n      <td width=\"100%\" data-sticky=\"false\"><span data-href=\"https://github.com/eyedol/checkin/blob/fcc8401e8ce393a98a25f7f436a1f9d3be88c18f/app/src/main/java/com/addhen/checkin/view/posts/PostsViewModel.kt#L58\"></span>Unnecessary semicolon</td>\n    </tr>\n  </tbody>\n</table>\n\n\n\n","created_at":"2018-09-15T11:45:58Z","updated_at":"2018-09-15T11:45:58Z","html_url":"https://github.com/eyedol/checkin/pull/30#discussion_r217883233","pull_request_url":"https://api.github.com/repos/eyedol/checkin/pulls/30","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/eyedol/checkin/pulls/comments/217883233"},"html":{"href":"https://github.com/eyedol/checkin/pull/30#discussion_r217883233"},"pull_request":{"href":"https://api.github.com/repos/eyedol/checkin/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/eyedol/checkin/pulls/30","id":215763667,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1NzYzNjY3","html_url":"https://github.com/eyedol/checkin/pull/30","diff_url":"https://github.com/eyedol/checkin/pull/30.diff","patch_url":"https://github.com/eyedol/checkin/pull/30.patch","issue_url":"https://api.github.com/repos/eyedol/checkin/issues/30","number":30,"state":"open","locked":false,"title":"Upgrade to Kotlin1.3 m2","user":{"login":"eyedol","id":73175,"node_id":"MDQ6VXNlcjczMTc1","avatar_url":"https://avatars0.githubusercontent.com/u/73175?v=4","gravatar_id":"","url":"https://api.github.com/users/eyedol","html_url":"https://github.com/eyedol","followers_url":"https://api.github.com/users/eyedol/followers","following_url":"https://api.github.com/users/eyedol/following{/other_user}","gists_url":"https://api.github.com/users/eyedol/gists{/gist_id}","starred_url":"https://api.github.com/users/eyedol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyedol/subscriptions","organizations_url":"https://api.github.com/users/eyedol/orgs","repos_url":"https://api.github.com/users/eyedol/repos","events_url":"https://api.github.com/users/eyedol/events{/privacy}","received_events_url":"https://api.github.com/users/eyedol/received_events","type":"User","site_admin":false},"body":"This fixes #14 ","created_at":"2018-09-15T10:56:44Z","updated_at":"2018-09-15T11:45:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f007e1029b119283a800b5322485d62e9e109d97","assignee":{"login":"eyedol","id":73175,"node_id":"MDQ6VXNlcjczMTc1","avatar_url":"https://avatars0.githubusercontent.com/u/73175?v=4","gravatar_id":"","url":"https://api.github.com/users/eyedol","html_url":"https://github.com/eyedol","followers_url":"https://api.github.com/users/eyedol/followers","following_url":"https://api.github.com/users/eyedol/following{/other_user}","gists_url":"https://api.github.com/users/eyedol/gists{/gist_id}","starred_url":"https://api.github.com/users/eyedol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyedol/subscriptions","organizations_url":"https://api.github.com/users/eyedol/orgs","repos_url":"https://api.github.com/users/eyedol/repos","events_url":"https://api.github.com/users/eyedol/events{/privacy}","received_events_url":"https://api.github.com/users/eyedol/received_events","type":"User","site_admin":false},"assignees":[{"login":"eyedol","id":73175,"node_id":"MDQ6VXNlcjczMTc1","avatar_url":"https://avatars0.githubusercontent.com/u/73175?v=4","gravatar_id":"","url":"https://api.github.com/users/eyedol","html_url":"https://github.com/eyedol","followers_url":"https://api.github.com/users/eyedol/followers","following_url":"https://api.github.com/users/eyedol/following{/other_user}","gists_url":"https://api.github.com/users/eyedol/gists{/gist_id}","starred_url":"https://api.github.com/users/eyedol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyedol/subscriptions","organizations_url":"https://api.github.com/users/eyedol/orgs","repos_url":"https://api.github.com/users/eyedol/repos","events_url":"https://api.github.com/users/eyedol/events{/privacy}","received_events_url":"https://api.github.com/users/eyedol/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/eyedol/checkin/pulls/30/commits","review_comments_url":"https://api.github.com/repos/eyedol/checkin/pulls/30/comments","review_comment_url":"https://api.github.com/repos/eyedol/checkin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eyedol/checkin/issues/30/comments","statuses_url":"https://api.github.com/repos/eyedol/checkin/statuses/fcc8401e8ce393a98a25f7f436a1f9d3be88c18f","head":{"label":"eyedol:upgradeKotlin1.3M2","ref":"upgradeKotlin1.3M2","sha":"fcc8401e8ce393a98a25f7f436a1f9d3be88c18f","user":{"login":"eyedol","id":73175,"node_id":"MDQ6VXNlcjczMTc1","avatar_url":"https://avatars0.githubusercontent.com/u/73175?v=4","gravatar_id":"","url":"https://api.github.com/users/eyedol","html_url":"https://github.com/eyedol","followers_url":"https://api.github.com/users/eyedol/followers","following_url":"https://api.github.com/users/eyedol/following{/other_user}","gists_url":"https://api.github.com/users/eyedol/gists{/gist_id}","starred_url":"https://api.github.com/users/eyedol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyedol/subscriptions","organizations_url":"https://api.github.com/users/eyedol/orgs","repos_url":"https://api.github.com/users/eyedol/repos","events_url":"https://api.github.com/users/eyedol/events{/privacy}","received_events_url":"https://api.github.com/users/eyedol/received_events","type":"User","site_admin":false},"repo":{"id":119366330,"node_id":"MDEwOlJlcG9zaXRvcnkxMTkzNjYzMzA=","name":"checkin","full_name":"eyedol/checkin","owner":{"login":"eyedol","id":73175,"node_id":"MDQ6VXNlcjczMTc1","avatar_url":"https://avatars0.githubusercontent.com/u/73175?v=4","gravatar_id":"","url":"https://api.github.com/users/eyedol","html_url":"https://github.com/eyedol","followers_url":"https://api.github.com/users/eyedol/followers","following_url":"https://api.github.com/users/eyedol/following{/other_user}","gists_url":"https://api.github.com/users/eyedol/gists{/gist_id}","starred_url":"https://api.github.com/users/eyedol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyedol/subscriptions","organizations_url":"https://api.github.com/users/eyedol/orgs","repos_url":"https://api.github.com/users/eyedol/repos","events_url":"https://api.github.com/users/eyedol/events{/privacy}","received_events_url":"https://api.github.com/users/eyedol/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eyedol/checkin","description":"Yet Another Android App","fork":false,"url":"https://api.github.com/repos/eyedol/checkin","forks_url":"https://api.github.com/repos/eyedol/checkin/forks","keys_url":"https://api.github.com/repos/eyedol/checkin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eyedol/checkin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eyedol/checkin/teams","hooks_url":"https://api.github.com/repos/eyedol/checkin/hooks","issue_events_url":"https://api.github.com/repos/eyedol/checkin/issues/events{/number}","events_url":"https://api.github.com/repos/eyedol/checkin/events","assignees_url":"https://api.github.com/repos/eyedol/checkin/assignees{/user}","branches_url":"https://api.github.com/repos/eyedol/checkin/branches{/branch}","tags_url":"https://api.github.com/repos/eyedol/checkin/tags","blobs_url":"https://api.github.com/repos/eyedol/checkin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eyedol/checkin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eyedol/checkin/git/refs{/sha}","trees_url":"https://api.github.com/repos/eyedol/checkin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eyedol/checkin/statuses/{sha}","languages_url":"https://api.github.com/repos/eyedol/checkin/languages","stargazers_url":"https://api.github.com/repos/eyedol/checkin/stargazers","contributors_url":"https://api.github.com/repos/eyedol/checkin/contributors","subscribers_url":"https://api.github.com/repos/eyedol/checkin/subscribers","subscription_url":"https://api.github.com/repos/eyedol/checkin/subscription","commits_url":"https://api.github.com/repos/eyedol/checkin/commits{/sha}","git_commits_url":"https://api.github.com/repos/eyedol/checkin/git/commits{/sha}","comments_url":"https://api.github.com/repos/eyedol/checkin/comments{/number}","issue_comment_url":"https://api.github.com/repos/eyedol/checkin/issues/comments{/number}","contents_url":"https://api.github.com/repos/eyedol/checkin/contents/{+path}","compare_url":"https://api.github.com/repos/eyedol/checkin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eyedol/checkin/merges","archive_url":"https://api.github.com/repos/eyedol/checkin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eyedol/checkin/downloads","issues_url":"https://api.github.com/repos/eyedol/checkin/issues{/number}","pulls_url":"https://api.github.com/repos/eyedol/checkin/pulls{/number}","milestones_url":"https://api.github.com/repos/eyedol/checkin/milestones{/number}","notifications_url":"https://api.github.com/repos/eyedol/checkin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eyedol/checkin/labels{/name}","releases_url":"https://api.github.com/repos/eyedol/checkin/releases{/id}","deployments_url":"https://api.github.com/repos/eyedol/checkin/deployments","created_at":"2018-01-29T10:12:18Z","updated_at":"2018-09-15T09:28:46Z","pushed_at":"2018-09-15T11:39:26Z","git_url":"git://github.com/eyedol/checkin.git","ssh_url":"git@github.com:eyedol/checkin.git","clone_url":"https://github.com/eyedol/checkin.git","svn_url":"https://github.com/eyedol/checkin","homepage":null,"size":275,"stargazers_count":3,"watchers_count":3,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":20,"watchers":3,"default_branch":"master"}},"base":{"label":"eyedol:master","ref":"master","sha":"643c29448bee9f46912d86a62d1941727e74458b","user":{"login":"eyedol","id":73175,"node_id":"MDQ6VXNlcjczMTc1","avatar_url":"https://avatars0.githubusercontent.com/u/73175?v=4","gravatar_id":"","url":"https://api.github.com/users/eyedol","html_url":"https://github.com/eyedol","followers_url":"https://api.github.com/users/eyedol/followers","following_url":"https://api.github.com/users/eyedol/following{/other_user}","gists_url":"https://api.github.com/users/eyedol/gists{/gist_id}","starred_url":"https://api.github.com/users/eyedol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyedol/subscriptions","organizations_url":"https://api.github.com/users/eyedol/orgs","repos_url":"https://api.github.com/users/eyedol/repos","events_url":"https://api.github.com/users/eyedol/events{/privacy}","received_events_url":"https://api.github.com/users/eyedol/received_events","type":"User","site_admin":false},"repo":{"id":119366330,"node_id":"MDEwOlJlcG9zaXRvcnkxMTkzNjYzMzA=","name":"checkin","full_name":"eyedol/checkin","owner":{"login":"eyedol","id":73175,"node_id":"MDQ6VXNlcjczMTc1","avatar_url":"https://avatars0.githubusercontent.com/u/73175?v=4","gravatar_id":"","url":"https://api.github.com/users/eyedol","html_url":"https://github.com/eyedol","followers_url":"https://api.github.com/users/eyedol/followers","following_url":"https://api.github.com/users/eyedol/following{/other_user}","gists_url":"https://api.github.com/users/eyedol/gists{/gist_id}","starred_url":"https://api.github.com/users/eyedol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyedol/subscriptions","organizations_url":"https://api.github.com/users/eyedol/orgs","repos_url":"https://api.github.com/users/eyedol/repos","events_url":"https://api.github.com/users/eyedol/events{/privacy}","received_events_url":"https://api.github.com/users/eyedol/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eyedol/checkin","description":"Yet Another Android App","fork":false,"url":"https://api.github.com/repos/eyedol/checkin","forks_url":"https://api.github.com/repos/eyedol/checkin/forks","keys_url":"https://api.github.com/repos/eyedol/checkin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eyedol/checkin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eyedol/checkin/teams","hooks_url":"https://api.github.com/repos/eyedol/checkin/hooks","issue_events_url":"https://api.github.com/repos/eyedol/checkin/issues/events{/number}","events_url":"https://api.github.com/repos/eyedol/checkin/events","assignees_url":"https://api.github.com/repos/eyedol/checkin/assignees{/user}","branches_url":"https://api.github.com/repos/eyedol/checkin/branches{/branch}","tags_url":"https://api.github.com/repos/eyedol/checkin/tags","blobs_url":"https://api.github.com/repos/eyedol/checkin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eyedol/checkin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eyedol/checkin/git/refs{/sha}","trees_url":"https://api.github.com/repos/eyedol/checkin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eyedol/checkin/statuses/{sha}","languages_url":"https://api.github.com/repos/eyedol/checkin/languages","stargazers_url":"https://api.github.com/repos/eyedol/checkin/stargazers","contributors_url":"https://api.github.com/repos/eyedol/checkin/contributors","subscribers_url":"https://api.github.com/repos/eyedol/checkin/subscribers","subscription_url":"https://api.github.com/repos/eyedol/checkin/subscription","commits_url":"https://api.github.com/repos/eyedol/checkin/commits{/sha}","git_commits_url":"https://api.github.com/repos/eyedol/checkin/git/commits{/sha}","comments_url":"https://api.github.com/repos/eyedol/checkin/comments{/number}","issue_comment_url":"https://api.github.com/repos/eyedol/checkin/issues/comments{/number}","contents_url":"https://api.github.com/repos/eyedol/checkin/contents/{+path}","compare_url":"https://api.github.com/repos/eyedol/checkin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eyedol/checkin/merges","archive_url":"https://api.github.com/repos/eyedol/checkin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eyedol/checkin/downloads","issues_url":"https://api.github.com/repos/eyedol/checkin/issues{/number}","pulls_url":"https://api.github.com/repos/eyedol/checkin/pulls{/number}","milestones_url":"https://api.github.com/repos/eyedol/checkin/milestones{/number}","notifications_url":"https://api.github.com/repos/eyedol/checkin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eyedol/checkin/labels{/name}","releases_url":"https://api.github.com/repos/eyedol/checkin/releases{/id}","deployments_url":"https://api.github.com/repos/eyedol/checkin/deployments","created_at":"2018-01-29T10:12:18Z","updated_at":"2018-09-15T09:28:46Z","pushed_at":"2018-09-15T11:39:26Z","git_url":"git://github.com/eyedol/checkin.git","ssh_url":"git@github.com:eyedol/checkin.git","clone_url":"https://github.com/eyedol/checkin.git","svn_url":"https://github.com/eyedol/checkin","homepage":null,"size":275,"stargazers_count":3,"watchers_count":3,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":20,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eyedol/checkin/pulls/30"},"html":{"href":"https://github.com/eyedol/checkin/pull/30"},"issue":{"href":"https://api.github.com/repos/eyedol/checkin/issues/30"},"comments":{"href":"https://api.github.com/repos/eyedol/checkin/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/eyedol/checkin/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/eyedol/checkin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eyedol/checkin/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/eyedol/checkin/statuses/fcc8401e8ce393a98a25f7f436a1f9d3be88c18f"}},"author_association":"OWNER"}}
{"actor":{"display_login":"eyedol"}}