{"action":"created","comment":{"url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls/comments/181142128","pull_request_review_id":111695573,"id":181142128,"diff_hunk":"@@ -9,51 +10,63 @@ class TradeItBrokerLogoService {\n     private var cache: [String: [TradeItBrokerLogoSize: UIImage]] = [:]\n \n     func loadLogo(\n-        forBroker broker: TradeItBroker,\n+        forBrokerId brokerIdOptional: String?,\n         withSize size: TradeItBrokerLogoSize,\n         onSuccess: @escaping (UIImage) -> Void,\n         onFailure: @escaping () -> Void\n     ) {\n-        guard let brokerName = broker.shortName,\n-            let logoMetadata = broker.logos as? [TradeItBrokerLogo],\n-            let logoData = logoMetadata.first(where: { $0.name == size.rawValue }),\n-            let logoUrlString = logoData.url,\n-            let logoUrl = URL(string: logoUrlString) else {\n-                return print(\"TradeIt Logo: No broker logo provided for \\(broker.shortName ?? \"\")\")\n-        }\n-\n-        if let cachedImage = getCachedLogo(brokerName: brokerName, size: size) {\n-            print(\"TradeIt Logo: Fetching cached logo for \\(brokerName)\")\n-            return onSuccess(cachedImage)\n-        }\n-\n-        print(\"TradeIt Logo: Fetching remote logo for \\(brokerName)\")\n-\n-        DispatchQueue.global(qos: .userInitiated).async {\n-            guard let imageData = NSData(contentsOf: logoUrl),\n-                let image = UIImage(data: imageData as Data) else {\n-                print(\"TradeIt Logo: Broker logo failed to load. \\(logoUrl)\")\n-                DispatchQueue.main.async(execute: onFailure)\n-                return\n+        TradeItSDK.uiConfigService.getUiConfigPromise().then { uiConfig in\n+            guard let brokerId = brokerIdOptional,\n+                let brokerConfigs = uiConfig.brokers as? [TradeItUiBrokerConfig],\n+                let brokerConfig = brokerConfigs.first(where: { $0.brokerId == brokerId }),\n+                let logoMetaData = brokerConfig.logos as? [TradeItBrokerLogo],\n+                let logoData = logoMetaData.first(where: { $0.name == size.rawValue }),\n+                let logoUrlString = logoData.url,\n+                let logoUrl = URL(string: logoUrlString)\n+                else {\n+                    print(\"TradeIt Logo: No broker logo provided for \\(brokerIdOptional ?? \"\")\")\n+                    return Promise(error: TradeItErrorResult())","path":"TradeItIosTicketSDK2/TradeItBrokerLogoService.swift","position":47,"original_position":47,"commit_id":"1c3c0504919209c2856fe78feb760e230bfed13b","original_commit_id":"1c3c0504919209c2856fe78feb760e230bfed13b","user":{"login":"jsom","id":65071,"avatar_url":"https://avatars0.githubusercontent.com/u/65071?v=4","gravatar_id":"","url":"https://api.github.com/users/jsom","html_url":"https://github.com/jsom","followers_url":"https://api.github.com/users/jsom/followers","following_url":"https://api.github.com/users/jsom/following{/other_user}","gists_url":"https://api.github.com/users/jsom/gists{/gist_id}","starred_url":"https://api.github.com/users/jsom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsom/subscriptions","organizations_url":"https://api.github.com/users/jsom/orgs","repos_url":"https://api.github.com/users/jsom/repos","events_url":"https://api.github.com/users/jsom/events{/privacy}","received_events_url":"https://api.github.com/users/jsom/received_events","type":"User","site_admin":false},"body":"Add error message to result","created_at":"2018-04-12T16:22:58Z","updated_at":"2018-04-12T16:43:08Z","html_url":"https://github.com/tradingticket/TradeItIosTicketSDK2/pull/329#discussion_r181142128","pull_request_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls/329","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls/comments/181142128"},"html":{"href":"https://github.com/tradingticket/TradeItIosTicketSDK2/pull/329#discussion_r181142128"},"pull_request":{"href":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls/329"}}},"pull_request":{"url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls/329","id":180695137,"html_url":"https://github.com/tradingticket/TradeItIosTicketSDK2/pull/329","diff_url":"https://github.com/tradingticket/TradeItIosTicketSDK2/pull/329.diff","patch_url":"https://github.com/tradingticket/TradeItIosTicketSDK2/pull/329.patch","issue_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/issues/329","number":329,"state":"open","locked":false,"title":"Add branding to Link, Ticket, and Preview screens","user":{"login":"oliver-was-here","id":10605247,"avatar_url":"https://avatars3.githubusercontent.com/u/10605247?v=4","gravatar_id":"","url":"https://api.github.com/users/oliver-was-here","html_url":"https://github.com/oliver-was-here","followers_url":"https://api.github.com/users/oliver-was-here/followers","following_url":"https://api.github.com/users/oliver-was-here/following{/other_user}","gists_url":"https://api.github.com/users/oliver-was-here/gists{/gist_id}","starred_url":"https://api.github.com/users/oliver-was-here/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliver-was-here/subscriptions","organizations_url":"https://api.github.com/users/oliver-was-here/orgs","repos_url":"https://api.github.com/users/oliver-was-here/repos","events_url":"https://api.github.com/users/oliver-was-here/events{/privacy}","received_events_url":"https://api.github.com/users/oliver-was-here/received_events","type":"User","site_admin":false},"body":"https://www.pivotaltracker.com/story/show/155711216","created_at":"2018-04-10T18:51:01Z","updated_at":"2018-04-12T16:43:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b2a2ba4965002b3b9336ed8dcee5d14d52fa6e2b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":416309685,"url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls/329/commits","review_comments_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls/329/comments","review_comment_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/issues/329/comments","statuses_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/statuses/1c3c0504919209c2856fe78feb760e230bfed13b","head":{"label":"tradingticket:jrs/#155837876/logos","ref":"jrs/#155837876/logos","sha":"1c3c0504919209c2856fe78feb760e230bfed13b","user":{"login":"tradingticket","id":7998787,"avatar_url":"https://avatars3.githubusercontent.com/u/7998787?v=4","gravatar_id":"","url":"https://api.github.com/users/tradingticket","html_url":"https://github.com/tradingticket","followers_url":"https://api.github.com/users/tradingticket/followers","following_url":"https://api.github.com/users/tradingticket/following{/other_user}","gists_url":"https://api.github.com/users/tradingticket/gists{/gist_id}","starred_url":"https://api.github.com/users/tradingticket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tradingticket/subscriptions","organizations_url":"https://api.github.com/users/tradingticket/orgs","repos_url":"https://api.github.com/users/tradingticket/repos","events_url":"https://api.github.com/users/tradingticket/events{/privacy}","received_events_url":"https://api.github.com/users/tradingticket/received_events","type":"Organization","site_admin":false},"repo":{"id":64491808,"name":"TradeItIosTicketSDK2","full_name":"tradingticket/TradeItIosTicketSDK2","owner":{"login":"tradingticket","id":7998787,"avatar_url":"https://avatars3.githubusercontent.com/u/7998787?v=4","gravatar_id":"","url":"https://api.github.com/users/tradingticket","html_url":"https://github.com/tradingticket","followers_url":"https://api.github.com/users/tradingticket/followers","following_url":"https://api.github.com/users/tradingticket/following{/other_user}","gists_url":"https://api.github.com/users/tradingticket/gists{/gist_id}","starred_url":"https://api.github.com/users/tradingticket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tradingticket/subscriptions","organizations_url":"https://api.github.com/users/tradingticket/orgs","repos_url":"https://api.github.com/users/tradingticket/repos","events_url":"https://api.github.com/users/tradingticket/events{/privacy}","received_events_url":"https://api.github.com/users/tradingticket/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tradingticket/TradeItIosTicketSDK2","description":"TradeIt iOS SDK to integrate trading and portfolio management.","fork":false,"url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2","forks_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/forks","keys_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/teams","hooks_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/hooks","issue_events_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/issues/events{/number}","events_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/events","assignees_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/assignees{/user}","branches_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/branches{/branch}","tags_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/tags","blobs_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/git/refs{/sha}","trees_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/statuses/{sha}","languages_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/languages","stargazers_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/stargazers","contributors_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/contributors","subscribers_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/subscribers","subscription_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/subscription","commits_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/commits{/sha}","git_commits_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/git/commits{/sha}","comments_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/comments{/number}","issue_comment_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/issues/comments{/number}","contents_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/contents/{+path}","compare_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/merges","archive_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/downloads","issues_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/issues{/number}","pulls_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls{/number}","milestones_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/milestones{/number}","notifications_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/labels{/name}","releases_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/releases{/id}","deployments_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/deployments","created_at":"2016-07-29T15:42:08Z","updated_at":"2018-04-11T02:25:56Z","pushed_at":"2018-04-12T16:42:09Z","git_url":"git://github.com/tradingticket/TradeItIosTicketSDK2.git","ssh_url":"git@github.com:tradingticket/TradeItIosTicketSDK2.git","clone_url":"https://github.com/tradingticket/TradeItIosTicketSDK2.git","svn_url":"https://github.com/tradingticket/TradeItIosTicketSDK2","homepage":"https://www.trade.it","size":8515,"stargazers_count":20,"watchers_count":20,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":12,"open_issues":11,"watchers":20,"default_branch":"develop"}},"base":{"label":"tradingticket:develop","ref":"develop","sha":"50b94af324e64ddd149a9789736389077626e36b","user":{"login":"tradingticket","id":7998787,"avatar_url":"https://avatars3.githubusercontent.com/u/7998787?v=4","gravatar_id":"","url":"https://api.github.com/users/tradingticket","html_url":"https://github.com/tradingticket","followers_url":"https://api.github.com/users/tradingticket/followers","following_url":"https://api.github.com/users/tradingticket/following{/other_user}","gists_url":"https://api.github.com/users/tradingticket/gists{/gist_id}","starred_url":"https://api.github.com/users/tradingticket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tradingticket/subscriptions","organizations_url":"https://api.github.com/users/tradingticket/orgs","repos_url":"https://api.github.com/users/tradingticket/repos","events_url":"https://api.github.com/users/tradingticket/events{/privacy}","received_events_url":"https://api.github.com/users/tradingticket/received_events","type":"Organization","site_admin":false},"repo":{"id":64491808,"name":"TradeItIosTicketSDK2","full_name":"tradingticket/TradeItIosTicketSDK2","owner":{"login":"tradingticket","id":7998787,"avatar_url":"https://avatars3.githubusercontent.com/u/7998787?v=4","gravatar_id":"","url":"https://api.github.com/users/tradingticket","html_url":"https://github.com/tradingticket","followers_url":"https://api.github.com/users/tradingticket/followers","following_url":"https://api.github.com/users/tradingticket/following{/other_user}","gists_url":"https://api.github.com/users/tradingticket/gists{/gist_id}","starred_url":"https://api.github.com/users/tradingticket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tradingticket/subscriptions","organizations_url":"https://api.github.com/users/tradingticket/orgs","repos_url":"https://api.github.com/users/tradingticket/repos","events_url":"https://api.github.com/users/tradingticket/events{/privacy}","received_events_url":"https://api.github.com/users/tradingticket/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tradingticket/TradeItIosTicketSDK2","description":"TradeIt iOS SDK to integrate trading and portfolio management.","fork":false,"url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2","forks_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/forks","keys_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/teams","hooks_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/hooks","issue_events_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/issues/events{/number}","events_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/events","assignees_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/assignees{/user}","branches_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/branches{/branch}","tags_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/tags","blobs_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/git/refs{/sha}","trees_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/statuses/{sha}","languages_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/languages","stargazers_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/stargazers","contributors_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/contributors","subscribers_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/subscribers","subscription_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/subscription","commits_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/commits{/sha}","git_commits_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/git/commits{/sha}","comments_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/comments{/number}","issue_comment_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/issues/comments{/number}","contents_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/contents/{+path}","compare_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/merges","archive_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/downloads","issues_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/issues{/number}","pulls_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls{/number}","milestones_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/milestones{/number}","notifications_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/labels{/name}","releases_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/releases{/id}","deployments_url":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/deployments","created_at":"2016-07-29T15:42:08Z","updated_at":"2018-04-11T02:25:56Z","pushed_at":"2018-04-12T16:42:09Z","git_url":"git://github.com/tradingticket/TradeItIosTicketSDK2.git","ssh_url":"git@github.com:tradingticket/TradeItIosTicketSDK2.git","clone_url":"https://github.com/tradingticket/TradeItIosTicketSDK2.git","svn_url":"https://github.com/tradingticket/TradeItIosTicketSDK2","homepage":"https://www.trade.it","size":8515,"stargazers_count":20,"watchers_count":20,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":12,"open_issues":11,"watchers":20,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls/329"},"html":{"href":"https://github.com/tradingticket/TradeItIosTicketSDK2/pull/329"},"issue":{"href":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/issues/329"},"comments":{"href":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/issues/329/comments"},"review_comments":{"href":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls/329/comments"},"review_comment":{"href":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/pulls/329/commits"},"statuses":{"href":"https://api.github.com/repos/tradingticket/TradeItIosTicketSDK2/statuses/1c3c0504919209c2856fe78feb760e230bfed13b"}},"author_association":"NONE"}}
{"actor":{"display_login":"jsom"}}