@@ -87,21 +87,23 @@ export class MediaDbAdvancedSearchModal extends Modal {
8787
8888 // const apiToggleComponents: Component[] = [];
8989 for ( const api of this . plugin . apiManager . apis ) {
90- const apiToggleListElementWrapper = contentEl . createEl ( 'div' , { cls : 'media-db-plugin-list-wrapper' } ) ;
90+ if ( this . plugin . settings [ [ api . apiName , "default" ] . filter ( s => s ) . join ( '' ) as keyof typeof this . plugin . settings ] || this . plugin . settings [ [ api . apiName , "game" ] . filter ( s => s ) . join ( '' ) as keyof typeof this . plugin . settings ] || this . plugin . settings [ [ api . apiName , "series" ] . filter ( s => s ) . join ( '' ) as keyof typeof this . plugin . settings ] || this . plugin . settings [ [ api . apiName , "movie" ] . filter ( s => s ) . join ( '' ) as keyof typeof this . plugin . settings ] ) {
91+ const apiToggleListElementWrapper = contentEl . createEl ( 'div' , { cls : 'media-db-plugin-list-wrapper' } ) ;
9192
92- const apiToggleTextWrapper = apiToggleListElementWrapper . createEl ( 'div' , { cls : 'media-db-plugin-list-text-wrapper' } ) ;
93- apiToggleTextWrapper . createEl ( 'span' , { text : api . apiName , cls : 'media-db-plugin-list-text' } ) ;
94- apiToggleTextWrapper . createEl ( 'small' , { text : api . apiDescription , cls : 'media-db-plugin-list-text' } ) ;
93+ const apiToggleTextWrapper = apiToggleListElementWrapper . createEl ( 'div' , { cls : 'media-db-plugin-list-text-wrapper' } ) ;
94+ apiToggleTextWrapper . createEl ( 'span' , { text : api . apiName , cls : 'media-db-plugin-list-text' } ) ;
95+ apiToggleTextWrapper . createEl ( 'small' , { text : api . apiDescription , cls : 'media-db-plugin-list-text' } ) ;
9596
96- const apiToggleComponentWrapper = apiToggleListElementWrapper . createEl ( 'div' , { cls : 'media-db-plugin-list-toggle' } ) ;
97+ const apiToggleComponentWrapper = apiToggleListElementWrapper . createEl ( 'div' , { cls : 'media-db-plugin-list-toggle' } ) ;
9798
98- const apiToggleComponent = new ToggleComponent ( apiToggleComponentWrapper ) ;
99- apiToggleComponent . setTooltip ( api . apiName ) ;
100- apiToggleComponent . setValue ( this . selectedApis . find ( x => x . name === api . apiName ) . selected ) ;
101- apiToggleComponent . onChange ( value => {
102- this . selectedApis . find ( x => x . name === api . apiName ) . selected = value ;
103- } ) ;
104- apiToggleComponentWrapper . appendChild ( apiToggleComponent . toggleEl ) ;
99+ const apiToggleComponent = new ToggleComponent ( apiToggleComponentWrapper ) ;
100+ apiToggleComponent . setTooltip ( api . apiName ) ;
101+ apiToggleComponent . setValue ( this . selectedApis . find ( x => x . name === api . apiName ) . selected ) ;
102+ apiToggleComponent . onChange ( value => {
103+ this . selectedApis . find ( x => x . name === api . apiName ) . selected = value ;
104+ } ) ;
105+ apiToggleComponentWrapper . appendChild ( apiToggleComponent . toggleEl ) ;
106+ }
105107 }
106108
107109 contentEl . createDiv ( { cls : 'media-db-plugin-spacer' } ) ;
0 commit comments