hunk.code_window:   }
     setTheme(theme) {
       this.ThemeManager.setTheme(theme);
       this.state.themeInProgress = true;
     }
     $onInit() {
  
hunk.labels: keep keep keep replace keep keep keep keep
hunk.after_edit:     if (theme === 'auto' || !theme) {
         this.ThemeManager.autoTheme();
       } else {
         this.ThemeManager.setTheme(theme);
       }
  
hunk.file_path: app/portainer/components/theme/theme-settings.controller.js
hunk.type: replace
file: angular.module('portainer.app').service('ThemeManager', ThemeManager);
  
  /* @ngInject */
  
  export function ThemeManager(StateManager) {
    return {
      setTheme,
      defaultTheme,
    };
  
    function setTheme(theme) {
      if (!theme) {
        document.documentElement.removeAttribute('theme');
      } else {
        document.documentElement.setAttribute('theme', theme);
      }
      StateManager.updateTheme(theme);
    }
  
    function defaultTheme() {
      document.documentElement.removeAttribute('theme');
    }
  }
  