removed notice setting
This commit is contained in:
		
							parent
							
								
									fc847b02b5
								
							
						
					
					
						commit
						325933f538
					
				| 
						 | 
				
			
			@ -111,7 +111,6 @@ export function getDefaultSettings(app: App): LocatorSettings {
 | 
			
		|||
 | 
			
		||||
    httpApiEnabled: false,
 | 
			
		||||
    httpApiPort: '51361',
 | 
			
		||||
    httpApiNotice: true,
 | 
			
		||||
 | 
			
		||||
    welcomeMessage: '',
 | 
			
		||||
    verboseLogging: false,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -50,17 +50,5 @@ export function injectSettingsHttp(
 | 
			
		|||
          await saveSettings(plugin)
 | 
			
		||||
        })
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    new Setting(containerEl)
 | 
			
		||||
      .setName('Show a notification when the server starts')
 | 
			
		||||
      .setDesc(
 | 
			
		||||
        'Will display a notification if the server is enabled, at Obsidian startup.'
 | 
			
		||||
      )
 | 
			
		||||
      .addToggle(toggle =>
 | 
			
		||||
        toggle.setValue(settings.httpApiNotice).onChange(async v => {
 | 
			
		||||
          settings.httpApiNotice = v
 | 
			
		||||
          await saveSettings(plugin)
 | 
			
		||||
        })
 | 
			
		||||
      )
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -80,7 +80,6 @@ export interface LocatorSettings extends WeightingSettings {
 | 
			
		|||
  fuzziness: '0' | '1' | '2'
 | 
			
		||||
  httpApiEnabled: boolean
 | 
			
		||||
  httpApiPort: string
 | 
			
		||||
  httpApiNotice: boolean
 | 
			
		||||
 | 
			
		||||
  DANGER_httpHost: string | null
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,10 +48,15 @@ export function getServer(plugin: LocatorPlugin) {
 | 
			
		|||
        },
 | 
			
		||||
        () => {
 | 
			
		||||
          console.log(`Locator - Started HTTP server on port ${port}`)
 | 
			
		||||
          if (plugin.settings.DANGER_httpHost && plugin.settings.DANGER_httpHost !== 'localhost') {
 | 
			
		||||
            new Notice(`Locator - Started non-localhost HTTP server at ${plugin.settings.DANGER_httpHost}:${port}`, 120_000)
 | 
			
		||||
          }
 | 
			
		||||
          else if (plugin.settings.httpApiNotice) {
 | 
			
		||||
          if (
 | 
			
		||||
            plugin.settings.DANGER_httpHost &&
 | 
			
		||||
            plugin.settings.DANGER_httpHost !== 'localhost'
 | 
			
		||||
          ) {
 | 
			
		||||
            new Notice(
 | 
			
		||||
              `Locator - Started non-localhost HTTP server at ${plugin.settings.DANGER_httpHost}:${port}`,
 | 
			
		||||
              120_000
 | 
			
		||||
            )
 | 
			
		||||
          } else {
 | 
			
		||||
            new Notice(`Locator - Started HTTP server on port ${port}`)
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -67,7 +72,7 @@ export function getServer(plugin: LocatorPlugin) {
 | 
			
		|||
    close() {
 | 
			
		||||
      server.close()
 | 
			
		||||
      console.log(`Locator - Terminated HTTP server`)
 | 
			
		||||
      if (plugin.settings.httpApiEnabled && plugin.settings.httpApiNotice) {
 | 
			
		||||
      if (plugin.settings.httpApiEnabled) {
 | 
			
		||||
        new Notice(`Locator - Terminated HTTP server`)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user