@@ -515,32 +515,32 @@ export class InvioSettingTab extends PluginSettingTab {
515
515
516
516
// =============== Hosting Settings ======================
517
517
518
- // const useHostDiv = containerEl.createEl("div");
519
- // useHostDiv.createEl("h2", { text: t('settings_host') });
520
- // new Setting(useHostDiv)
521
- // .setName(t('settings_host_switch_title'))
522
- // .setDesc(t('settings_host_switch_desc'))
523
- // .addToggle(tog => {
524
- // tog.setValue(this.plugin.settings.useHost)
525
- // .onChange(async (val) => {
526
- // this.plugin.settings.useHost = val;
527
- // await this.plugin.saveSettings();
528
- // if (this.plugin.settings.useHost) {
529
- // await this.plugin.enableHostService()
530
- // .catch(err => {
531
- // new Notice(t('settings_host_enable_error'));
532
- // })
533
- // .finally(() => {
534
- // this.hide();
535
- // this.display();
536
- // })
537
- // } else {
538
- // await this.plugin.disableHostService();
539
- // this.hide();
540
- // this.display();
541
- // }
542
- // })
543
- // })
518
+ const useHostDiv = containerEl . createEl ( "div" ) ;
519
+ useHostDiv . createEl ( "h2" , { text : t ( 'settings_host' ) } ) ;
520
+ new Setting ( useHostDiv )
521
+ . setName ( t ( 'settings_host_switch_title' ) )
522
+ . setDesc ( t ( 'settings_host_switch_desc' ) )
523
+ . addToggle ( tog => {
524
+ tog . setValue ( this . plugin . settings . useHost )
525
+ . onChange ( async ( val ) => {
526
+ this . plugin . settings . useHost = val ;
527
+ await this . plugin . saveSettings ( ) ;
528
+ if ( this . plugin . settings . useHost ) {
529
+ await this . plugin . enableHostService ( )
530
+ . catch ( err => {
531
+ new Notice ( t ( 'settings_host_enable_error' ) ) ;
532
+ } )
533
+ . finally ( ( ) => {
534
+ this . hide ( ) ;
535
+ this . display ( ) ;
536
+ } )
537
+ } else {
538
+ await this . plugin . disableHostService ( ) ;
539
+ this . hide ( ) ;
540
+ this . display ( ) ;
541
+ }
542
+ } )
543
+ } )
544
544
545
545
if ( this . plugin . settings . useHost ) {
546
546
const hostingDiv = containerEl . createEl ( "div" , { cls : 'settings-config-section' } ) ;
0 commit comments