File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 2626 </ div >
2727 </ div >
2828
29- <!-- ko ifnot : mediaItem.blobKey -->
29+ <!-- ko if : mediaItem.isReferenced -->
3030 < div class ="form-group ">
3131 < label for ="downloadUrl " class ="form-label ">
3232 Reference URL
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export class MediaItem {
1919 public mimeType : ko . Observable < string > ;
2020 public widgetFactoryResult : IWidgetFactoryResult < any , any > ;
2121 public nonPreviewable : ko . Computed < boolean > ;
22+ public isReferenced : ko . Computed < boolean > ;
2223
2324
2425 constructor ( mediaContract : MediaContract ) {
@@ -33,6 +34,11 @@ export class MediaItem {
3334 this . thumbnailUrl = ko . observable < string > ( ) ;
3435 this . downloadUrl = ko . observable < string > ( mediaContract . downloadUrl ) ;
3536 this . setThumbnail ( mediaContract ) ;
37+
38+ this . isReferenced = ko . computed ( ( ) => {
39+ return ! ! mediaContract . downloadUrl
40+ && ( mediaContract . downloadUrl . startsWith ( "https://" ) || mediaContract . downloadUrl . startsWith ( "https//" ) ) ;
41+ } ) ;
3642 }
3743
3844 private async setThumbnail ( mediaContract : MediaContract ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments