@@ -24,6 +24,8 @@ require('gfm.css/gfm.css');
2424require ( 'highlight.js/styles/github.css' ) ;
2525require ( 'draft-js/dist/Draft.css' ) ;
2626
27+ import olmWasmPath from 'olm/olm.wasm' ;
28+
2729import './rageshakesetup' ;
2830
2931import React from 'react' ;
@@ -379,18 +381,19 @@ function loadOlm() {
379381 *
380382 * We also need to tell the Olm js to look for its wasm file at the same
381383 * level as index.html. It really should be in the same place as the js,
382- * ie. in the bundle directory, to avoid caching issues, but as far as I
383- * can tell this is completely impossible with webpack.
384+ * ie. in the bundle directory, but as far as I can tell this is
385+ * completely impossible with webpack. We do, however, use a hashed
386+ * filename to avoid caching issues.
384387 */
385388 return Olm . init ( {
386- locateFile : ( ) => 'olm.wasm' ,
389+ locateFile : ( ) => olmWasmPath ,
387390 } ) . then ( ( ) => {
388391 console . log ( "Using WebAssembly Olm" ) ;
389392 } ) . catch ( ( e ) => {
390393 console . log ( "Failed to load Olm: trying legacy version" ) ;
391394 return new Promise ( ( resolve , reject ) => {
392395 const s = document . createElement ( 'script' ) ;
393- s . src = 'olm_legacy.js' ;
396+ s . src = 'olm_legacy.js' ; // XXX: This should be cache-busted too
394397 s . onload = resolve ;
395398 s . onerror = reject ;
396399 document . body . appendChild ( s ) ;
0 commit comments