Skip to content

Commit

Permalink
Fix oppia#7239: $sce.trustAsResourceUrl is called after the url is co…
Browse files Browse the repository at this point in the history
…nstructed (oppia#7243)

* fixes use image in local

* fixes use image in local
  • Loading branch information
Kevin Thomas authored and aks681 committed Jul 29, 2019
1 parent 105ba20 commit d6bdca8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions extensions/objects/templates/FilepathEditorDirective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,10 @@ oppia.directive('filepathEditor', [

var getTrustedResourceUrlForImageFileName = function(imageFileName) {
var encodedFilepath = window.encodeURIComponent(imageFileName);
return $sce.trustAsResourceUrl(
AssetsBackendApiService.getImageUrlForPreviewAsync(
ctrl.explorationId, encodedFilepath));
return AssetsBackendApiService.getImageUrlForPreviewAsync(
ctrl.explorationId, encodedFilepath).then(function(url) {
return $sce.trustAsResourceUrl(url);
});
};

/** Scope variables and functions (visibles to the view) */
Expand Down

0 comments on commit d6bdca8

Please sign in to comment.