Re-jig config accessors
We only ever used the static instance() method to get to the config object, so just make a static instance that returns the ConfigOptions directly, throwing an exception if it's not yet initialised. This way the types can all be non-optional (plus it's shorter).
This commit is contained in:
		
					parent
					
						
							
								6303b357ab
							
						
					
				
			
			
				commit
				
					
						c879090a34
					
				
			
		
					 4 changed files with 19 additions and 20 deletions
				
			
		| 
						 | 
				
			
			@ -191,13 +191,10 @@ export class Initializer {
 | 
			
		|||
      this.loadStates.sentry === LoadState.None &&
 | 
			
		||||
      this.loadStates.config === LoadState.Loaded
 | 
			
		||||
    ) {
 | 
			
		||||
      if (
 | 
			
		||||
        Config.instance.config.sentry?.DSN &&
 | 
			
		||||
        Config.instance.config.sentry?.environment
 | 
			
		||||
      ) {
 | 
			
		||||
      if (Config.get().sentry?.DSN && Config.get().sentry?.environment) {
 | 
			
		||||
        Sentry.init({
 | 
			
		||||
          dsn: Config.instance.config.sentry?.DSN,
 | 
			
		||||
          environment: Config.instance.config.sentry?.environment,
 | 
			
		||||
          dsn: Config.get().sentry?.DSN,
 | 
			
		||||
          environment: Config.get().sentry?.environment,
 | 
			
		||||
          integrations: [
 | 
			
		||||
            new Integrations.BrowserTracing({
 | 
			
		||||
              routingInstrumentation:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue