{"action":"created","comment":{"url":"https://api.github.com/repos/textileio/textile-mobile/pulls/comments/208318946","pull_request_review_id":144104020,"id":208318946,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODMxODk0Ng==","diff_hunk":"@@ -85,6 +109,95 @@ export function reducer (state: CameraRollState = initialState, action: CameraRo\n       )\n       return { ...state, queriedPhotos }\n     }\n+    case getType(actions.imagePickerSuccess):\n+      const { image } = action.payload\n+      const threadShares = state.pendingShares\n+\n+      if (threadShares[action.payload.threadId] === undefined) {\n+        // add the image uir to the thread's pending shares\n+        threadShares[action.payload.threadId] = [image]\n+      } else {\n+        if (state.pendingShares[action.payload.threadId].find((img) => img.origURL === image.origURL)) {\n+          // if the image already exists as a pending invite to the thread... skip it\n+          return state\n+        } else {\n+          // add the image to the thread's pending shares\n+          threadShares[action.payload.threadId].push(image)\n+        }\n+      }\n+      return {...state, pendingShares: threadShares}\n+    case getType(actions.addComment):\n+      if (state.pendingShares[action.payload.threadId] === undefined) {\n+        return state\n+      }\n+      const existing = state.pendingShares[action.payload.threadId].find(img=>img.origURL === action.payload.image.origURL)\n+      if (!existing || existing.caption !== undefined) {\n+        return state\n+      }\n+      existing.caption = action.payload.caption\n+\n+      const thread = state.pendingShares[action.payload.threadId].filter((img) => img.origURL !== action.payload.image.origURL)\n+      thread.push(existing)\n+\n+      return {\n+        ...state,\n+        pendingShares: {\n+          ...state.pendingShares,\n+          [action.payload.threadId]: thread\n+        }\n+      }\n+    case getType(actions.localPinSuccess):\n+      if (state.pendingShares[action.payload.threadId] === undefined) {\n+        return state\n+      }\n+      const partial = state.pendingShares[action.payload.threadId].find(img=>img.origURL === action.payload.image.origURL)\n+      if (!partial || partial.addResult !== undefined) {\n+        return state\n+      }\n+      partial.addResult = action.payload.addResult\n+\n+      const ps = state.pendingShares[action.payload.threadId].filter((img) => img.origURL !== action.payload.image.origURL)\n+      ps.push(partial)","path":"App/Redux/CameraRollRedux.ts","position":104,"original_position":104,"commit_id":"a272ff61e7102d293f3559f3268dfe125411f68b","original_commit_id":"a272ff61e7102d293f3559f3268dfe125411f68b","user":{"login":"asutula","id":528969,"node_id":"MDQ6VXNlcjUyODk2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/528969?v=4","gravatar_id":"","url":"https://api.github.com/users/asutula","html_url":"https://github.com/asutula","followers_url":"https://api.github.com/users/asutula/followers","following_url":"https://api.github.com/users/asutula/following{/other_user}","gists_url":"https://api.github.com/users/asutula/gists{/gist_id}","starred_url":"https://api.github.com/users/asutula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asutula/subscriptions","organizations_url":"https://api.github.com/users/asutula/orgs","repos_url":"https://api.github.com/users/asutula/repos","events_url":"https://api.github.com/users/asutula/events{/privacy}","received_events_url":"https://api.github.com/users/asutula/received_events","type":"User","site_admin":false},"body":"Same here, cleaner with a `map`","created_at":"2018-08-07T17:31:38Z","updated_at":"2018-08-07T17:31:39Z","html_url":"https://github.com/textileio/textile-mobile/pull/314#discussion_r208318946","pull_request_url":"https://api.github.com/repos/textileio/textile-mobile/pulls/314","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/textileio/textile-mobile/pulls/comments/208318946"},"html":{"href":"https://github.com/textileio/textile-mobile/pull/314#discussion_r208318946"},"pull_request":{"href":"https://api.github.com/repos/textileio/textile-mobile/pulls/314"}}},"pull_request":{"url":"https://api.github.com/repos/textileio/textile-mobile/pulls/314","id":206569618,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NTY5NjE4","html_url":"https://github.com/textileio/textile-mobile/pull/314","diff_url":"https://github.com/textileio/textile-mobile/pull/314.diff","patch_url":"https://github.com/textileio/textile-mobile/pull/314.patch","issue_url":"https://api.github.com/repos/textileio/textile-mobile/issues/314","number":314,"state":"open","locked":false,"title":"Photo picker","user":{"login":"andrewxhill","id":370259,"node_id":"MDQ6VXNlcjM3MDI1OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/370259?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewxhill","html_url":"https://github.com/andrewxhill","followers_url":"https://api.github.com/users/andrewxhill/followers","following_url":"https://api.github.com/users/andrewxhill/following{/other_user}","gists_url":"https://api.github.com/users/andrewxhill/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewxhill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewxhill/subscriptions","organizations_url":"https://api.github.com/users/andrewxhill/orgs","repos_url":"https://api.github.com/users/andrewxhill/repos","events_url":"https://api.github.com/users/andrewxhill/events{/privacy}","received_events_url":"https://api.github.com/users/andrewxhill/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-07T03:24:12Z","updated_at":"2018-08-07T17:31:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f504f7c66cce3395aad73a08d59b62af1aa15bf","assignee":{"login":"asutula","id":528969,"node_id":"MDQ6VXNlcjUyODk2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/528969?v=4","gravatar_id":"","url":"https://api.github.com/users/asutula","html_url":"https://github.com/asutula","followers_url":"https://api.github.com/users/asutula/followers","following_url":"https://api.github.com/users/asutula/following{/other_user}","gists_url":"https://api.github.com/users/asutula/gists{/gist_id}","starred_url":"https://api.github.com/users/asutula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asutula/subscriptions","organizations_url":"https://api.github.com/users/asutula/orgs","repos_url":"https://api.github.com/users/asutula/repos","events_url":"https://api.github.com/users/asutula/events{/privacy}","received_events_url":"https://api.github.com/users/asutula/received_events","type":"User","site_admin":false},"assignees":[{"login":"asutula","id":528969,"node_id":"MDQ6VXNlcjUyODk2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/528969?v=4","gravatar_id":"","url":"https://api.github.com/users/asutula","html_url":"https://github.com/asutula","followers_url":"https://api.github.com/users/asutula/followers","following_url":"https://api.github.com/users/asutula/following{/other_user}","gists_url":"https://api.github.com/users/asutula/gists{/gist_id}","starred_url":"https://api.github.com/users/asutula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asutula/subscriptions","organizations_url":"https://api.github.com/users/asutula/orgs","repos_url":"https://api.github.com/users/asutula/repos","events_url":"https://api.github.com/users/asutula/events{/privacy}","received_events_url":"https://api.github.com/users/asutula/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/textileio/textile-mobile/pulls/314/commits","review_comments_url":"https://api.github.com/repos/textileio/textile-mobile/pulls/314/comments","review_comment_url":"https://api.github.com/repos/textileio/textile-mobile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/textileio/textile-mobile/issues/314/comments","statuses_url":"https://api.github.com/repos/textileio/textile-mobile/statuses/a272ff61e7102d293f3559f3268dfe125411f68b","head":{"label":"textileio:andrew/photo-picker","ref":"andrew/photo-picker","sha":"a272ff61e7102d293f3559f3268dfe125411f68b","user":{"login":"textileio","id":35050041,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MDUwMDQx","avatar_url":"https://avatars3.githubusercontent.com/u/35050041?v=4","gravatar_id":"","url":"https://api.github.com/users/textileio","html_url":"https://github.com/textileio","followers_url":"https://api.github.com/users/textileio/followers","following_url":"https://api.github.com/users/textileio/following{/other_user}","gists_url":"https://api.github.com/users/textileio/gists{/gist_id}","starred_url":"https://api.github.com/users/textileio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/textileio/subscriptions","organizations_url":"https://api.github.com/users/textileio/orgs","repos_url":"https://api.github.com/users/textileio/repos","events_url":"https://api.github.com/users/textileio/events{/privacy}","received_events_url":"https://api.github.com/users/textileio/received_events","type":"Organization","site_admin":false},"repo":{"id":128835983,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg4MzU5ODM=","name":"textile-mobile","full_name":"textileio/textile-mobile","owner":{"login":"textileio","id":35050041,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MDUwMDQx","avatar_url":"https://avatars3.githubusercontent.com/u/35050041?v=4","gravatar_id":"","url":"https://api.github.com/users/textileio","html_url":"https://github.com/textileio","followers_url":"https://api.github.com/users/textileio/followers","following_url":"https://api.github.com/users/textileio/following{/other_user}","gists_url":"https://api.github.com/users/textileio/gists{/gist_id}","starred_url":"https://api.github.com/users/textileio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/textileio/subscriptions","organizations_url":"https://api.github.com/users/textileio/orgs","repos_url":"https://api.github.com/users/textileio/repos","events_url":"https://api.github.com/users/textileio/events{/privacy}","received_events_url":"https://api.github.com/users/textileio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/textileio/textile-mobile","description":"Encrypted, secure, decentralized personal data wallet -- technology behind textile.photos","fork":false,"url":"https://api.github.com/repos/textileio/textile-mobile","forks_url":"https://api.github.com/repos/textileio/textile-mobile/forks","keys_url":"https://api.github.com/repos/textileio/textile-mobile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/textileio/textile-mobile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/textileio/textile-mobile/teams","hooks_url":"https://api.github.com/repos/textileio/textile-mobile/hooks","issue_events_url":"https://api.github.com/repos/textileio/textile-mobile/issues/events{/number}","events_url":"https://api.github.com/repos/textileio/textile-mobile/events","assignees_url":"https://api.github.com/repos/textileio/textile-mobile/assignees{/user}","branches_url":"https://api.github.com/repos/textileio/textile-mobile/branches{/branch}","tags_url":"https://api.github.com/repos/textileio/textile-mobile/tags","blobs_url":"https://api.github.com/repos/textileio/textile-mobile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/textileio/textile-mobile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/textileio/textile-mobile/git/refs{/sha}","trees_url":"https://api.github.com/repos/textileio/textile-mobile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/textileio/textile-mobile/statuses/{sha}","languages_url":"https://api.github.com/repos/textileio/textile-mobile/languages","stargazers_url":"https://api.github.com/repos/textileio/textile-mobile/stargazers","contributors_url":"https://api.github.com/repos/textileio/textile-mobile/contributors","subscribers_url":"https://api.github.com/repos/textileio/textile-mobile/subscribers","subscription_url":"https://api.github.com/repos/textileio/textile-mobile/subscription","commits_url":"https://api.github.com/repos/textileio/textile-mobile/commits{/sha}","git_commits_url":"https://api.github.com/repos/textileio/textile-mobile/git/commits{/sha}","comments_url":"https://api.github.com/repos/textileio/textile-mobile/comments{/number}","issue_comment_url":"https://api.github.com/repos/textileio/textile-mobile/issues/comments{/number}","contents_url":"https://api.github.com/repos/textileio/textile-mobile/contents/{+path}","compare_url":"https://api.github.com/repos/textileio/textile-mobile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/textileio/textile-mobile/merges","archive_url":"https://api.github.com/repos/textileio/textile-mobile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/textileio/textile-mobile/downloads","issues_url":"https://api.github.com/repos/textileio/textile-mobile/issues{/number}","pulls_url":"https://api.github.com/repos/textileio/textile-mobile/pulls{/number}","milestones_url":"https://api.github.com/repos/textileio/textile-mobile/milestones{/number}","notifications_url":"https://api.github.com/repos/textileio/textile-mobile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/textileio/textile-mobile/labels{/name}","releases_url":"https://api.github.com/repos/textileio/textile-mobile/releases{/id}","deployments_url":"https://api.github.com/repos/textileio/textile-mobile/deployments","created_at":"2018-04-09T21:28:41Z","updated_at":"2018-08-07T00:38:49Z","pushed_at":"2018-08-07T16:36:02Z","git_url":"git://github.com/textileio/textile-mobile.git","ssh_url":"git@github.com:textileio/textile-mobile.git","clone_url":"https://github.com/textileio/textile-mobile.git","svn_url":"https://github.com/textileio/textile-mobile","homepage":"https://www.textile.photos/","size":3944445,"stargazers_count":61,"watchers_count":61,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":46,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":5,"open_issues":46,"watchers":61,"default_branch":"master"}},"base":{"label":"textileio:master","ref":"master","sha":"23e24da552a71042223fad195eecb9c5e81757ce","user":{"login":"textileio","id":35050041,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MDUwMDQx","avatar_url":"https://avatars3.githubusercontent.com/u/35050041?v=4","gravatar_id":"","url":"https://api.github.com/users/textileio","html_url":"https://github.com/textileio","followers_url":"https://api.github.com/users/textileio/followers","following_url":"https://api.github.com/users/textileio/following{/other_user}","gists_url":"https://api.github.com/users/textileio/gists{/gist_id}","starred_url":"https://api.github.com/users/textileio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/textileio/subscriptions","organizations_url":"https://api.github.com/users/textileio/orgs","repos_url":"https://api.github.com/users/textileio/repos","events_url":"https://api.github.com/users/textileio/events{/privacy}","received_events_url":"https://api.github.com/users/textileio/received_events","type":"Organization","site_admin":false},"repo":{"id":128835983,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg4MzU5ODM=","name":"textile-mobile","full_name":"textileio/textile-mobile","owner":{"login":"textileio","id":35050041,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MDUwMDQx","avatar_url":"https://avatars3.githubusercontent.com/u/35050041?v=4","gravatar_id":"","url":"https://api.github.com/users/textileio","html_url":"https://github.com/textileio","followers_url":"https://api.github.com/users/textileio/followers","following_url":"https://api.github.com/users/textileio/following{/other_user}","gists_url":"https://api.github.com/users/textileio/gists{/gist_id}","starred_url":"https://api.github.com/users/textileio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/textileio/subscriptions","organizations_url":"https://api.github.com/users/textileio/orgs","repos_url":"https://api.github.com/users/textileio/repos","events_url":"https://api.github.com/users/textileio/events{/privacy}","received_events_url":"https://api.github.com/users/textileio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/textileio/textile-mobile","description":"Encrypted, secure, decentralized personal data wallet -- technology behind textile.photos","fork":false,"url":"https://api.github.com/repos/textileio/textile-mobile","forks_url":"https://api.github.com/repos/textileio/textile-mobile/forks","keys_url":"https://api.github.com/repos/textileio/textile-mobile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/textileio/textile-mobile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/textileio/textile-mobile/teams","hooks_url":"https://api.github.com/repos/textileio/textile-mobile/hooks","issue_events_url":"https://api.github.com/repos/textileio/textile-mobile/issues/events{/number}","events_url":"https://api.github.com/repos/textileio/textile-mobile/events","assignees_url":"https://api.github.com/repos/textileio/textile-mobile/assignees{/user}","branches_url":"https://api.github.com/repos/textileio/textile-mobile/branches{/branch}","tags_url":"https://api.github.com/repos/textileio/textile-mobile/tags","blobs_url":"https://api.github.com/repos/textileio/textile-mobile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/textileio/textile-mobile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/textileio/textile-mobile/git/refs{/sha}","trees_url":"https://api.github.com/repos/textileio/textile-mobile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/textileio/textile-mobile/statuses/{sha}","languages_url":"https://api.github.com/repos/textileio/textile-mobile/languages","stargazers_url":"https://api.github.com/repos/textileio/textile-mobile/stargazers","contributors_url":"https://api.github.com/repos/textileio/textile-mobile/contributors","subscribers_url":"https://api.github.com/repos/textileio/textile-mobile/subscribers","subscription_url":"https://api.github.com/repos/textileio/textile-mobile/subscription","commits_url":"https://api.github.com/repos/textileio/textile-mobile/commits{/sha}","git_commits_url":"https://api.github.com/repos/textileio/textile-mobile/git/commits{/sha}","comments_url":"https://api.github.com/repos/textileio/textile-mobile/comments{/number}","issue_comment_url":"https://api.github.com/repos/textileio/textile-mobile/issues/comments{/number}","contents_url":"https://api.github.com/repos/textileio/textile-mobile/contents/{+path}","compare_url":"https://api.github.com/repos/textileio/textile-mobile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/textileio/textile-mobile/merges","archive_url":"https://api.github.com/repos/textileio/textile-mobile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/textileio/textile-mobile/downloads","issues_url":"https://api.github.com/repos/textileio/textile-mobile/issues{/number}","pulls_url":"https://api.github.com/repos/textileio/textile-mobile/pulls{/number}","milestones_url":"https://api.github.com/repos/textileio/textile-mobile/milestones{/number}","notifications_url":"https://api.github.com/repos/textileio/textile-mobile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/textileio/textile-mobile/labels{/name}","releases_url":"https://api.github.com/repos/textileio/textile-mobile/releases{/id}","deployments_url":"https://api.github.com/repos/textileio/textile-mobile/deployments","created_at":"2018-04-09T21:28:41Z","updated_at":"2018-08-07T00:38:49Z","pushed_at":"2018-08-07T16:36:02Z","git_url":"git://github.com/textileio/textile-mobile.git","ssh_url":"git@github.com:textileio/textile-mobile.git","clone_url":"https://github.com/textileio/textile-mobile.git","svn_url":"https://github.com/textileio/textile-mobile","homepage":"https://www.textile.photos/","size":3944445,"stargazers_count":61,"watchers_count":61,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":46,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":5,"open_issues":46,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/textileio/textile-mobile/pulls/314"},"html":{"href":"https://github.com/textileio/textile-mobile/pull/314"},"issue":{"href":"https://api.github.com/repos/textileio/textile-mobile/issues/314"},"comments":{"href":"https://api.github.com/repos/textileio/textile-mobile/issues/314/comments"},"review_comments":{"href":"https://api.github.com/repos/textileio/textile-mobile/pulls/314/comments"},"review_comment":{"href":"https://api.github.com/repos/textileio/textile-mobile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/textileio/textile-mobile/pulls/314/commits"},"statuses":{"href":"https://api.github.com/repos/textileio/textile-mobile/statuses/a272ff61e7102d293f3559f3268dfe125411f68b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"asutula"}}