@@ -42,7 +42,6 @@ import {
42
42
TemporaryStorageService ,
43
43
TranslationsService ,
44
44
UIAnimation ,
45
- UIConstants ,
46
45
} from 'ngx-edu-sharing-ui' ;
47
46
import { BehaviorSubject , Subject } from 'rxjs' ;
48
47
import { filter , first , skipWhile , takeUntil } from 'rxjs/operators' ;
@@ -441,11 +440,11 @@ export class RenderPageComponent implements EventListener, OnInit, OnDestroy, Af
441
440
download . elementType = OptionsHelperService . DownloadElementTypes ;
442
441
// use callback since isEnabled gets ignored
443
442
download . customEnabledCallback = async ( nodes ) => {
444
- return (
445
- this . _node . downloadUrl != null &&
446
- ( ! this . _node . properties [ RestConstants . CCM_PROP_IO_WWWURL ] ||
447
- ! this . _fromHomeRepository )
448
- ) ;
443
+ return this . downloadUrl
444
+ ? true
445
+ : this . _node . downloadUrl != null &&
446
+ ( ! this . _node . properties [ RestConstants . CCM_PROP_IO_WWWURL ] ||
447
+ ! this . _fromHomeRepository ) ;
449
448
} ;
450
449
download . group = DefaultGroups . View ;
451
450
download . priority = 25 ;
@@ -664,6 +663,7 @@ export class RenderPageComponent implements EventListener, OnInit, OnDestroy, Af
664
663
this . nodeApi
665
664
. getNodeChildobjects ( this . sequenceParent . ref . id , this . sequenceParent . ref . repo )
666
665
. subscribe ( ( data : NodeList ) => {
666
+ console . log ( 'add' , 'download' , download ) ;
667
667
this . downloadButton = download ;
668
668
const options : OptionItem [ ] = [ ] ;
669
669
options . splice ( 0 , 0 , download ) ;
@@ -687,14 +687,11 @@ export class RenderPageComponent implements EventListener, OnInit, OnDestroy, Af
687
687
this . initOptions ( ) ;
688
688
} ) ;
689
689
}
690
- setDownloadUrl ( url : string ) {
691
- console . info ( 'url from rendering' , url ) ;
692
- if ( this . downloadButton != null ) {
693
- this . downloadButton . customEnabledCallback = async ( ) => url != null ;
694
- }
695
690
691
+ async setDownloadUrl ( url : string ) {
692
+ console . info ( 'url from rendering' , url ) ;
696
693
this . downloadUrl = url ;
697
- this . initOptions ( ) ;
694
+ this . optionsHelper . refreshComponents ( ) ;
698
695
}
699
696
700
697
private getSequence ( onFinish : ( ) => void ) {
0 commit comments