@@ -8,7 +8,8 @@ import * as BackgroundFilter from "../elements/custom-background-filter";
88import * as ConfigEvent from "../observables/config-event" ;
99import * as DB from "../db" ;
1010import * as Notifications from "../elements/notifications" ;
11- import * as Loader from "../elements/loader" ;
11+
12+ import { showLoaderBar , hideLoaderBar } from "../signals/loader-bar" ;
1213import { debounce } from "throttle-debounce" ;
1314import { ThemeName } from "@monkeytype/schemas/configs" ;
1415import { themes , ThemesList } from "../constants/themes" ;
@@ -93,7 +94,7 @@ export async function loadStyle(name: string): Promise<void> {
9394 console . debug ( "Theme controller loading style" , name ) ;
9495 loadStyleLoaderTimeouts . push (
9596 setTimeout ( ( ) => {
96- Loader . show ( ) ;
97+ showLoaderBar ( ) ;
9798 } , 100 ) ,
9899 ) ;
99100 qs ( "#nextTheme" ) ?. remove ( ) ;
@@ -104,7 +105,7 @@ export async function loadStyle(name: string): Promise<void> {
104105 link . id = "nextTheme" ;
105106 link . onload = ( ) : void => {
106107 console . debug ( "Theme controller loaded style" , name ) ;
107- Loader . hide ( ) ;
108+ hideLoaderBar ( ) ;
108109 swapCurrentToNext ( ) ;
109110 loadStyleLoaderTimeouts . map ( ( t ) => clearTimeout ( t ) ) ;
110111 loadStyleLoaderTimeouts = [ ] ;
@@ -114,7 +115,7 @@ export async function loadStyle(name: string): Promise<void> {
114115 link . onerror = ( e ) : void => {
115116 console . debug ( "Theme controller failed to load style" , name , e ) ;
116117 console . error ( `Failed to load theme ${ name } ` , e ) ;
117- Loader . hide ( ) ;
118+ hideLoaderBar ( ) ;
118119 Notifications . add ( "Failed to load theme" , 0 ) ;
119120 swapCurrentToNext ( ) ;
120121 loadStyleLoaderTimeouts . map ( ( t ) => clearTimeout ( t ) ) ;
0 commit comments