22import request from 'superagent' ;
33
44import template from './transcript.html' ;
5- import domain_logo from '../../images/Atlas.png' ;
5+ import atlas_logo from '../../images/Atlas.png' ;
66import moment from "moment" ;
77import _ from 'lodash' ;
88
@@ -13,17 +13,32 @@ export default ['$http', 'transcriptService', '$stateParams', function($http, tr
1313 templateUrl :template ,
1414 link : function ( scope , element ) {
1515
16- scope . domain_logo_secondary = domain_logo ;
16+ scope . domain_logo_secondary = atlas_logo ;
1717
1818 scope . transcriptLoading = true ;
1919
20+ function logo ( transcript , url ) {
21+
22+ if ( ! url ) {
23+ // TODO: hack for demo
24+ const isAtlas = transcript . user . givenName === 'Olivia' ;
25+ return isAtlas ? atlas_logo : null ;
26+ } else if ( ! url . startsWith ( "http" ) ) {
27+ const host = window . lo_api_config && window . lo_api_config . root
28+ return host ? host + url : null ;
29+ } else {
30+ return url ;
31+ }
32+
33+ scope . domain_logo_secondary = transcript . organization . logo ;
34+ }
35+
2036 transcriptService . getTranscriptForUser ( $stateParams . userId )
2137 . then ( transcript => {
2238
23- // TODO: parameterize the logo
24- const isAtlas = transcript . user . givenName === 'Olivia' ;
39+ scope . domain_logo_secondary = logo ( transcript , transcript . organization . logo ) ;
2540
26- scope . domain_logo_secondary = isAtlas ? domain_logo : transcript . organization . logo ;
41+ console . log ( "Logo: " + scope . domain_logo_secondary ) ;
2742
2843 scope . transcriptLoading = false ;
2944 console . log ( 'got:' , transcript )
0 commit comments