@@ -45,12 +45,15 @@ const externalDependencies: ExternalDependency[] = [
4545] ;
4646
4747// Some variables to keep track of the initialisation progress.
48- // Note: the 2 initial steps are to import libOpenCOR's WASM and to instantiate it. Then, we have one or two steps per
49- // external dependency, depending on whether it has an associated CSS file or not.
48+ // Note: the 2 initial steps are to import libOpenCOR's WASM and to instantiate it. We then have one or two steps per
49+ // external dependency, depending on whether it has an associated CSS file or not. Finally, we have one step to
50+ // initialise xxHash.
5051
5152const crtNbOfSteps = vue . ref < number > ( 0 ) ;
5253const totalNbOfSteps =
53- ( electronApi ? 0 : 2 ) + externalDependencies . reduce ( ( acc , dep ) => acc + ( dep . url ? 1 : 0 ) + ( dep . cssUrl ? 1 : 0 ) , 0 ) ;
54+ ( electronApi ? 0 : 2 ) +
55+ externalDependencies . reduce ( ( acc , dep ) => acc + ( dep . url ? 1 : 0 ) + ( dep . cssUrl ? 1 : 0 ) , 0 ) +
56+ 1 ;
5457
5558// Retrieve the version of libOpenCOR that is to be used. Two options:
5659// - OpenCOR: libOpenCOR can be accessed using window.locApi, which references our C++ API.
@@ -155,7 +158,7 @@ const initialisationError = (error: unknown): void => {
155158 failed . value = true ;
156159} ;
157160
158- // Initialise libOpenCOR and then our external dependencies.
161+ // Initialise libOpenCOR, our external dependencies, and xxHash .
159162
160163initialiseLocApi ( ) . catch ( ( error : unknown ) => {
161164 initialisationError ( error ) ;
@@ -172,6 +175,14 @@ for (const externalDependency of externalDependencies) {
172175 } ) ;
173176}
174177
178+ dependencies . initialiseXxhash
179+ . then ( ( ) => {
180+ ++ crtNbOfSteps . value ;
181+ } )
182+ . catch ( ( error : unknown ) => {
183+ initialisationError ( error ) ;
184+ } ) ;
185+
175186// Let people know whether initialisation is done and how it's progressing.
176187
177188export const done = vue . computed ( ( ) => {
0 commit comments