File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636 < body style ="height: 100%; ">
3737 < section id ="matrixchat " style ="height: 100%; "> </ section >
3838 < noscript > Sorry, Riot requires JavaScript to be enabled.</ noscript > <!-- TODO: Translate this? -->
39- < % for (var i=0; i < htmlWebpackPlugin .files.js.length; i++) {
40- if (_.endsWith(htmlWebpackPlugin.files.js[i], 'olm.js')) {
41- var array = htmlWebpackPlugin.files.js;
42- htmlWebpackPlugin.files.js.unshift(htmlWebpackPlugin.files.js[i]);
43- htmlWebpackPlugin.files.js.splice(i, 1);
44- }
45- }
46-
47- for (var i =0; i < htmlWebpackPlugin.files.js.length; i++) {
48- // Not a particularly graceful way of not putting the indexeddb worker script
49- // into the main page
50- if (_.endsWith(htmlWebpackPlugin.files.js[i], 'indexeddb-worker.js')) {
51- %>
52- < script >
53- window . vector_indexeddb_worker_script = '<%= htmlWebpackPlugin.files.js[i] %>' ;
54- </ script >
55- < %
56- continue;
57- }
58- %>
59- < script src ="<%= htmlWebpackPlugin.files.js[i] %> "> </ script >
60- < % } %>
39+ < script >
40+ window . vector_indexeddb_worker_script = '<%= htmlWebpackPlugin.files.chunks[' indexeddb - worker '].entry %>' ;
41+ </ script >
42+ < script src ="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %> "> </ script >
6143 < img src ="img/warning.svg " width ="24 " height ="23 " style ="visibility: hidden; position: absolute; top: 0px; left: 0px; "/>
6244 < audio id ="messageAudio ">
6345 < source src ="media/message.ogg " type ="audio/ogg " />
Original file line number Diff line number Diff line change @@ -209,6 +209,13 @@ function onTokenLoginCompleted() {
209209}
210210
211211async function loadApp ( ) {
212+ if ( window . vector_indexeddb_worker_script === undefined ) {
213+ // If this is missing, something has probably gone wrong with
214+ // the bundling. The js-sdk will just fall back to accessing
215+ // indexeddb directly with no worker script, but we want to
216+ // make sure the indexeddb script is present, so fail hard.
217+ throw new Error ( "Missing indexeddb worker script!" ) ;
218+ }
212219 MatrixClientPeg . setIndexedDbWorkerScript ( window . vector_indexeddb_worker_script ) ;
213220 CallHandler . setConferenceHandler ( VectorConferenceHandler ) ;
214221
Original file line number Diff line number Diff line change @@ -18,4 +18,4 @@ import {IndexedDBStoreWorker} from 'matrix-js-sdk/lib/indexeddb-worker.js';
1818
1919const remoteWorker = new IndexedDBStoreWorker ( postMessage ) ;
2020
21- export const onmessage = remoteWorker . onMessage ;
21+ global . onmessage = remoteWorker . onMessage ;
You can’t perform that action at this time.
0 commit comments