{"action":"created","comment":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/comments/231049941","pull_request_review_id":171925778,"id":231049941,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTA0OTk0MQ==","diff_hunk":"@@ -0,0 +1,31 @@\n+package org.wordpress.android.ui.stats.refresh\n+\n+import android.arch.lifecycle.LiveData\n+import android.arch.lifecycle.Transformations\n+import kotlinx.coroutines.experimental.CoroutineScope\n+import kotlinx.coroutines.experimental.launch\n+import org.wordpress.android.fluxc.model.SiteModel\n+import org.wordpress.android.modules.UI_SCOPE\n+import org.wordpress.android.ui.stats.refresh.InsightsUiState.StatsListState.DONE\n+import javax.inject.Inject\n+import javax.inject.Named\n+\n+class InsightsTabViewModel @Inject constructor(\n+    @Named(UI_SCOPE) private val uiScope: CoroutineScope,\n+    private val insightsViewModel: InsightsViewModel\n+) : StatsListViewModel() {\n+    private val _data = Transformations.map(insightsViewModel.data) { loadedData ->\n+        InsightsUiState(loadedData, DONE)\n+    }\n+    override val data: LiveData<InsightsUiState> = _data\n+\n+    override fun start(site: SiteModel) {\n+        reload(site)\n+    }\n+\n+    override fun reload(site: SiteModel) {\n+        uiScope.launch {\n+            insightsViewModel.loadInsightItems(site, false)","path":"WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/InsightsTabViewModel.kt","position":28,"original_position":28,"commit_id":"41914b46731aec285714142c20f3260fa9144f29","original_commit_id":"41914b46731aec285714142c20f3260fa9144f29","user":{"login":"planarvoid","id":1079756,"node_id":"MDQ6VXNlcjEwNzk3NTY=","avatar_url":"https://avatars0.githubusercontent.com/u/1079756?v=4","gravatar_id":"","url":"https://api.github.com/users/planarvoid","html_url":"https://github.com/planarvoid","followers_url":"https://api.github.com/users/planarvoid/followers","following_url":"https://api.github.com/users/planarvoid/following{/other_user}","gists_url":"https://api.github.com/users/planarvoid/gists{/gist_id}","starred_url":"https://api.github.com/users/planarvoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/planarvoid/subscriptions","organizations_url":"https://api.github.com/users/planarvoid/orgs","repos_url":"https://api.github.com/users/planarvoid/repos","events_url":"https://api.github.com/users/planarvoid/events{/privacy}","received_events_url":"https://api.github.com/users/planarvoid/received_events","type":"User","site_admin":false},"body":"This should have the `forced` parameter set to `true`. When the user pulls to refresh, we want to make sure they get the fresh data.","created_at":"2018-11-06T09:28:13Z","updated_at":"2018-11-06T09:39:19Z","html_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/8545#discussion_r231049941","pull_request_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/8545","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/comments/231049941"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-Android/pull/8545#discussion_r231049941"},"pull_request":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/8545"}}},"pull_request":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/8545","id":228299241,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4Mjk5MjQx","html_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/8545","diff_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/8545.diff","patch_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/8545.patch","issue_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/8545","number":8545,"state":"open","locked":false,"title":"Issue/8331 add refresh logic","user":{"login":"0nko","id":1522856,"node_id":"MDQ6VXNlcjE1MjI4NTY=","avatar_url":"https://avatars0.githubusercontent.com/u/1522856?v=4","gravatar_id":"","url":"https://api.github.com/users/0nko","html_url":"https://github.com/0nko","followers_url":"https://api.github.com/users/0nko/followers","following_url":"https://api.github.com/users/0nko/following{/other_user}","gists_url":"https://api.github.com/users/0nko/gists{/gist_id}","starred_url":"https://api.github.com/users/0nko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0nko/subscriptions","organizations_url":"https://api.github.com/users/0nko/orgs","repos_url":"https://api.github.com/users/0nko/repos","events_url":"https://api.github.com/users/0nko/events{/privacy}","received_events_url":"https://api.github.com/users/0nko/received_events","type":"User","site_admin":false},"body":"Fixes #8331.\r\n\r\nThis PR fixes the pull-to-refresh behavior and loading status display + makes the necessary class refactoring.\r\n","created_at":"2018-11-05T10:11:04Z","updated_at":"2018-11-06T09:39:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"56a9268a83b0ef5390d701db4bbfe671a9e68716","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":967889584,"node_id":"MDU6TGFiZWw5Njc4ODk1ODQ=","url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/labels/Stats%20Refresh","name":"Stats Refresh","color":"ddaa2a","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/8545/commits","review_comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/8545/comments","review_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/8545/comments","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/41914b46731aec285714142c20f3260fa9144f29","head":{"label":"wordpress-mobile:issue/8331-add-refresh-logic","ref":"issue/8331-add-refresh-logic","sha":"41914b46731aec285714142c20f3260fa9144f29","user":{"login":"wordpress-mobile","id":1306301,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDYzMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1306301?v=4","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":9306568,"node_id":"MDEwOlJlcG9zaXRvcnk5MzA2NTY4","name":"WordPress-Android","full_name":"wordpress-mobile/WordPress-Android","private":false,"owner":{"login":"wordpress-mobile","id":1306301,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDYzMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1306301?v=4","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/wordpress-mobile/WordPress-Android","description":"WordPress for Android","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/releases{/id}","deployments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/deployments","created_at":"2013-04-08T20:52:40Z","updated_at":"2018-11-06T05:16:58Z","pushed_at":"2018-11-06T09:19:17Z","git_url":"git://github.com/wordpress-mobile/WordPress-Android.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-Android.git","clone_url":"https://github.com/wordpress-mobile/WordPress-Android.git","svn_url":"https://github.com/wordpress-mobile/WordPress-Android","homepage":"http://android.wordpress.org","size":201291,"stargazers_count":1879,"watchers_count":1879,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":966,"mirror_url":null,"archived":false,"open_issues_count":356,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":966,"open_issues":356,"watchers":1879,"default_branch":"develop"}},"base":{"label":"wordpress-mobile:feature/stats_refresh_readonly","ref":"feature/stats_refresh_readonly","sha":"66ed45de1baf21cc41241c3f33f546e8b1b0f81d","user":{"login":"wordpress-mobile","id":1306301,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDYzMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1306301?v=4","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":9306568,"node_id":"MDEwOlJlcG9zaXRvcnk5MzA2NTY4","name":"WordPress-Android","full_name":"wordpress-mobile/WordPress-Android","private":false,"owner":{"login":"wordpress-mobile","id":1306301,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDYzMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1306301?v=4","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/wordpress-mobile/WordPress-Android","description":"WordPress for Android","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/releases{/id}","deployments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/deployments","created_at":"2013-04-08T20:52:40Z","updated_at":"2018-11-06T05:16:58Z","pushed_at":"2018-11-06T09:19:17Z","git_url":"git://github.com/wordpress-mobile/WordPress-Android.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-Android.git","clone_url":"https://github.com/wordpress-mobile/WordPress-Android.git","svn_url":"https://github.com/wordpress-mobile/WordPress-Android","homepage":"http://android.wordpress.org","size":201291,"stargazers_count":1879,"watchers_count":1879,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":966,"mirror_url":null,"archived":false,"open_issues_count":356,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":966,"open_issues":356,"watchers":1879,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/8545"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-Android/pull/8545"},"issue":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/8545"},"comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/8545/comments"},"review_comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/8545/comments"},"review_comment":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/8545/commits"},"statuses":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/41914b46731aec285714142c20f3260fa9144f29"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"planarvoid"}}