{"action":"created","comment":{"url":"https://api.github.com/repos/shoutem/ui/pulls/comments/79346105","id":79346105,"diff_hunk":"@@ -23,7 +23,7 @@ class Image extends Component {\n \n     // defaultSource is not supported on Android, so we manually\n     // reassign the defaultSource prop to source if source is not defined\n-    if ((Platform.OS === 'android') && (!source || !source.uri)) {\n+    if (Platform.OS === 'android' && !source) {","path":"components/Image.js","position":5,"original_position":5,"commit_id":"6da6e5a538d4b5e3a05a3697376cdf664f7bf776","original_commit_id":"6da6e5a538d4b5e3a05a3697376cdf664f7bf776","user":{"login":"zrumenjak","id":1282315,"avatar_url":"https://avatars.githubusercontent.com/u/1282315?v=3","gravatar_id":"","url":"https://api.github.com/users/zrumenjak","html_url":"https://github.com/zrumenjak","followers_url":"https://api.github.com/users/zrumenjak/followers","following_url":"https://api.github.com/users/zrumenjak/following{/other_user}","gists_url":"https://api.github.com/users/zrumenjak/gists{/gist_id}","starred_url":"https://api.github.com/users/zrumenjak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zrumenjak/subscriptions","organizations_url":"https://api.github.com/users/zrumenjak/orgs","repos_url":"https://api.github.com/users/zrumenjak/repos","events_url":"https://api.github.com/users/zrumenjak/events{/privacy}","received_events_url":"https://api.github.com/users/zrumenjak/received_events","type":"User","site_admin":false},"body":"The original condition was here to handle cases when image URL may be undefined. For example, you often have an API response with optional URLs. If we removed the `!source.url` part of the condition then you will have to do something like this in those cases:\r\n```\r\n<Image source={user.avatarUrl ? { uri: user.avatarUrl } : undefined} />\r\n```\r\ninstead of simply doing it like:\r\n```\r\n<Image source={{ uri: user.avatarUrl }} />\r\n```\r\n\r\nTo support both use cases, we should detect if the source is a `require` call, and explicitly handle that case. It looks like the `require` will return a number, based on the prop types from react-native `Image`: https://github.com/facebook/react-native/blob/master/Libraries/Image/Image.android.js#L94-L95.","created_at":"2016-09-19T08:37:36Z","updated_at":"2016-09-19T08:40:55Z","html_url":"https://github.com/shoutem/ui/pull/28#discussion_r79346105","pull_request_url":"https://api.github.com/repos/shoutem/ui/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/shoutem/ui/pulls/comments/79346105"},"html":{"href":"https://github.com/shoutem/ui/pull/28#discussion_r79346105"},"pull_request":{"href":"https://api.github.com/repos/shoutem/ui/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/shoutem/ui/pulls/28","id":85685912,"html_url":"https://github.com/shoutem/ui/pull/28","diff_url":"https://github.com/shoutem/ui/pull/28.diff","patch_url":"https://github.com/shoutem/ui/pull/28.patch","issue_url":"https://api.github.com/repos/shoutem/ui/issues/28","number":28,"state":"open","locked":false,"title":"Fix defaultSource special case for Android","user":{"login":"plougsgaard","id":487223,"avatar_url":"https://avatars.githubusercontent.com/u/487223?v=3","gravatar_id":"","url":"https://api.github.com/users/plougsgaard","html_url":"https://github.com/plougsgaard","followers_url":"https://api.github.com/users/plougsgaard/followers","following_url":"https://api.github.com/users/plougsgaard/following{/other_user}","gists_url":"https://api.github.com/users/plougsgaard/gists{/gist_id}","starred_url":"https://api.github.com/users/plougsgaard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plougsgaard/subscriptions","organizations_url":"https://api.github.com/users/plougsgaard/orgs","repos_url":"https://api.github.com/users/plougsgaard/repos","events_url":"https://api.github.com/users/plougsgaard/events{/privacy}","received_events_url":"https://api.github.com/users/plougsgaard/received_events","type":"User","site_admin":false},"body":"```\r\n<Image source={require('./image.png')} />\r\n```\r\n\r\nThis relaxes the restriction to allow `Image`s like above.","created_at":"2016-09-17T20:20:28Z","updated_at":"2016-09-19T08:40:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c63db20671869bbbb0bd9bfc59263824d3cf3a6b","assignee":{"login":"zrumenjak","id":1282315,"avatar_url":"https://avatars.githubusercontent.com/u/1282315?v=3","gravatar_id":"","url":"https://api.github.com/users/zrumenjak","html_url":"https://github.com/zrumenjak","followers_url":"https://api.github.com/users/zrumenjak/followers","following_url":"https://api.github.com/users/zrumenjak/following{/other_user}","gists_url":"https://api.github.com/users/zrumenjak/gists{/gist_id}","starred_url":"https://api.github.com/users/zrumenjak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zrumenjak/subscriptions","organizations_url":"https://api.github.com/users/zrumenjak/orgs","repos_url":"https://api.github.com/users/zrumenjak/repos","events_url":"https://api.github.com/users/zrumenjak/events{/privacy}","received_events_url":"https://api.github.com/users/zrumenjak/received_events","type":"User","site_admin":false},"assignees":[{"login":"zrumenjak","id":1282315,"avatar_url":"https://avatars.githubusercontent.com/u/1282315?v=3","gravatar_id":"","url":"https://api.github.com/users/zrumenjak","html_url":"https://github.com/zrumenjak","followers_url":"https://api.github.com/users/zrumenjak/followers","following_url":"https://api.github.com/users/zrumenjak/following{/other_user}","gists_url":"https://api.github.com/users/zrumenjak/gists{/gist_id}","starred_url":"https://api.github.com/users/zrumenjak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zrumenjak/subscriptions","organizations_url":"https://api.github.com/users/zrumenjak/orgs","repos_url":"https://api.github.com/users/zrumenjak/repos","events_url":"https://api.github.com/users/zrumenjak/events{/privacy}","received_events_url":"https://api.github.com/users/zrumenjak/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/shoutem/ui/pulls/28/commits","review_comments_url":"https://api.github.com/repos/shoutem/ui/pulls/28/comments","review_comment_url":"https://api.github.com/repos/shoutem/ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shoutem/ui/issues/28/comments","statuses_url":"https://api.github.com/repos/shoutem/ui/statuses/6da6e5a538d4b5e3a05a3697376cdf664f7bf776","head":{"label":"plougsgaard:fix-android-image","ref":"fix-android-image","sha":"6da6e5a538d4b5e3a05a3697376cdf664f7bf776","user":{"login":"plougsgaard","id":487223,"avatar_url":"https://avatars.githubusercontent.com/u/487223?v=3","gravatar_id":"","url":"https://api.github.com/users/plougsgaard","html_url":"https://github.com/plougsgaard","followers_url":"https://api.github.com/users/plougsgaard/followers","following_url":"https://api.github.com/users/plougsgaard/following{/other_user}","gists_url":"https://api.github.com/users/plougsgaard/gists{/gist_id}","starred_url":"https://api.github.com/users/plougsgaard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plougsgaard/subscriptions","organizations_url":"https://api.github.com/users/plougsgaard/orgs","repos_url":"https://api.github.com/users/plougsgaard/repos","events_url":"https://api.github.com/users/plougsgaard/events{/privacy}","received_events_url":"https://api.github.com/users/plougsgaard/received_events","type":"User","site_admin":false},"repo":{"id":68475357,"name":"ui","full_name":"plougsgaard/ui","owner":{"login":"plougsgaard","id":487223,"avatar_url":"https://avatars.githubusercontent.com/u/487223?v=3","gravatar_id":"","url":"https://api.github.com/users/plougsgaard","html_url":"https://github.com/plougsgaard","followers_url":"https://api.github.com/users/plougsgaard/followers","following_url":"https://api.github.com/users/plougsgaard/following{/other_user}","gists_url":"https://api.github.com/users/plougsgaard/gists{/gist_id}","starred_url":"https://api.github.com/users/plougsgaard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plougsgaard/subscriptions","organizations_url":"https://api.github.com/users/plougsgaard/orgs","repos_url":"https://api.github.com/users/plougsgaard/repos","events_url":"https://api.github.com/users/plougsgaard/events{/privacy}","received_events_url":"https://api.github.com/users/plougsgaard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/plougsgaard/ui","description":"Customizable set of components for React Native applications","fork":true,"url":"https://api.github.com/repos/plougsgaard/ui","forks_url":"https://api.github.com/repos/plougsgaard/ui/forks","keys_url":"https://api.github.com/repos/plougsgaard/ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plougsgaard/ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plougsgaard/ui/teams","hooks_url":"https://api.github.com/repos/plougsgaard/ui/hooks","issue_events_url":"https://api.github.com/repos/plougsgaard/ui/issues/events{/number}","events_url":"https://api.github.com/repos/plougsgaard/ui/events","assignees_url":"https://api.github.com/repos/plougsgaard/ui/assignees{/user}","branches_url":"https://api.github.com/repos/plougsgaard/ui/branches{/branch}","tags_url":"https://api.github.com/repos/plougsgaard/ui/tags","blobs_url":"https://api.github.com/repos/plougsgaard/ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plougsgaard/ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plougsgaard/ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/plougsgaard/ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plougsgaard/ui/statuses/{sha}","languages_url":"https://api.github.com/repos/plougsgaard/ui/languages","stargazers_url":"https://api.github.com/repos/plougsgaard/ui/stargazers","contributors_url":"https://api.github.com/repos/plougsgaard/ui/contributors","subscribers_url":"https://api.github.com/repos/plougsgaard/ui/subscribers","subscription_url":"https://api.github.com/repos/plougsgaard/ui/subscription","commits_url":"https://api.github.com/repos/plougsgaard/ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/plougsgaard/ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/plougsgaard/ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/plougsgaard/ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/plougsgaard/ui/contents/{+path}","compare_url":"https://api.github.com/repos/plougsgaard/ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plougsgaard/ui/merges","archive_url":"https://api.github.com/repos/plougsgaard/ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plougsgaard/ui/downloads","issues_url":"https://api.github.com/repos/plougsgaard/ui/issues{/number}","pulls_url":"https://api.github.com/repos/plougsgaard/ui/pulls{/number}","milestones_url":"https://api.github.com/repos/plougsgaard/ui/milestones{/number}","notifications_url":"https://api.github.com/repos/plougsgaard/ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plougsgaard/ui/labels{/name}","releases_url":"https://api.github.com/repos/plougsgaard/ui/releases{/id}","deployments_url":"https://api.github.com/repos/plougsgaard/ui/deployments","created_at":"2016-09-17T20:03:03Z","updated_at":"2016-09-17T20:03:04Z","pushed_at":"2016-09-17T20:15:00Z","git_url":"git://github.com/plougsgaard/ui.git","ssh_url":"git@github.com:plougsgaard/ui.git","clone_url":"https://github.com/plougsgaard/ui.git","svn_url":"https://github.com/plougsgaard/ui","homepage":"","size":46684,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"shoutem:develop","ref":"develop","sha":"094b249b9a8884f622cdcf6fe33e810cfb727c15","user":{"login":"shoutem","id":962929,"avatar_url":"https://avatars.githubusercontent.com/u/962929?v=3","gravatar_id":"","url":"https://api.github.com/users/shoutem","html_url":"https://github.com/shoutem","followers_url":"https://api.github.com/users/shoutem/followers","following_url":"https://api.github.com/users/shoutem/following{/other_user}","gists_url":"https://api.github.com/users/shoutem/gists{/gist_id}","starred_url":"https://api.github.com/users/shoutem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoutem/subscriptions","organizations_url":"https://api.github.com/users/shoutem/orgs","repos_url":"https://api.github.com/users/shoutem/repos","events_url":"https://api.github.com/users/shoutem/events{/privacy}","received_events_url":"https://api.github.com/users/shoutem/received_events","type":"Organization","site_admin":false},"repo":{"id":65215684,"name":"ui","full_name":"shoutem/ui","owner":{"login":"shoutem","id":962929,"avatar_url":"https://avatars.githubusercontent.com/u/962929?v=3","gravatar_id":"","url":"https://api.github.com/users/shoutem","html_url":"https://github.com/shoutem","followers_url":"https://api.github.com/users/shoutem/followers","following_url":"https://api.github.com/users/shoutem/following{/other_user}","gists_url":"https://api.github.com/users/shoutem/gists{/gist_id}","starred_url":"https://api.github.com/users/shoutem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoutem/subscriptions","organizations_url":"https://api.github.com/users/shoutem/orgs","repos_url":"https://api.github.com/users/shoutem/repos","events_url":"https://api.github.com/users/shoutem/events{/privacy}","received_events_url":"https://api.github.com/users/shoutem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shoutem/ui","description":"Customizable set of components for React Native applications","fork":false,"url":"https://api.github.com/repos/shoutem/ui","forks_url":"https://api.github.com/repos/shoutem/ui/forks","keys_url":"https://api.github.com/repos/shoutem/ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shoutem/ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shoutem/ui/teams","hooks_url":"https://api.github.com/repos/shoutem/ui/hooks","issue_events_url":"https://api.github.com/repos/shoutem/ui/issues/events{/number}","events_url":"https://api.github.com/repos/shoutem/ui/events","assignees_url":"https://api.github.com/repos/shoutem/ui/assignees{/user}","branches_url":"https://api.github.com/repos/shoutem/ui/branches{/branch}","tags_url":"https://api.github.com/repos/shoutem/ui/tags","blobs_url":"https://api.github.com/repos/shoutem/ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shoutem/ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shoutem/ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/shoutem/ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shoutem/ui/statuses/{sha}","languages_url":"https://api.github.com/repos/shoutem/ui/languages","stargazers_url":"https://api.github.com/repos/shoutem/ui/stargazers","contributors_url":"https://api.github.com/repos/shoutem/ui/contributors","subscribers_url":"https://api.github.com/repos/shoutem/ui/subscribers","subscription_url":"https://api.github.com/repos/shoutem/ui/subscription","commits_url":"https://api.github.com/repos/shoutem/ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/shoutem/ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/shoutem/ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/shoutem/ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/shoutem/ui/contents/{+path}","compare_url":"https://api.github.com/repos/shoutem/ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shoutem/ui/merges","archive_url":"https://api.github.com/repos/shoutem/ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shoutem/ui/downloads","issues_url":"https://api.github.com/repos/shoutem/ui/issues{/number}","pulls_url":"https://api.github.com/repos/shoutem/ui/pulls{/number}","milestones_url":"https://api.github.com/repos/shoutem/ui/milestones{/number}","notifications_url":"https://api.github.com/repos/shoutem/ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shoutem/ui/labels{/name}","releases_url":"https://api.github.com/repos/shoutem/ui/releases{/id}","deployments_url":"https://api.github.com/repos/shoutem/ui/deployments","created_at":"2016-08-08T15:26:08Z","updated_at":"2016-09-19T08:35:33Z","pushed_at":"2016-09-17T20:20:28Z","git_url":"git://github.com/shoutem/ui.git","ssh_url":"git@github.com:shoutem/ui.git","clone_url":"https://github.com/shoutem/ui.git","svn_url":"https://github.com/shoutem/ui","homepage":"","size":46694,"stargazers_count":757,"watchers_count":757,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":25,"mirror_url":null,"open_issues_count":3,"forks":25,"open_issues":3,"watchers":757,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/shoutem/ui/pulls/28"},"html":{"href":"https://github.com/shoutem/ui/pull/28"},"issue":{"href":"https://api.github.com/repos/shoutem/ui/issues/28"},"comments":{"href":"https://api.github.com/repos/shoutem/ui/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/shoutem/ui/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/shoutem/ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shoutem/ui/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/shoutem/ui/statuses/6da6e5a538d4b5e3a05a3697376cdf664f7bf776"}}}}
{"actor":{"display_login":"zrumenjak"}}