Fixed sequential execution of scripts when using instant loading

This commit is contained in:
squidfunk 2020-08-30 13:37:59 +02:00
parent 9ab9508f9b
commit 935c384789
6 changed files with 7 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"assets/javascripts/bundle.js": "assets/javascripts/bundle.d23ec273.min.js", "assets/javascripts/bundle.js": "assets/javascripts/bundle.f0e39e8b.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.d23ec273.min.js.map", "assets/javascripts/bundle.js.map": "assets/javascripts/bundle.f0e39e8b.min.js.map",
"assets/javascripts/vendor.js": "assets/javascripts/vendor.11f47dfd.min.js", "assets/javascripts/vendor.js": "assets/javascripts/vendor.11f47dfd.min.js",
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.11f47dfd.min.js.map", "assets/javascripts/vendor.js.map": "assets/javascripts/vendor.11f47dfd.min.js.map",
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.fae956e7.min.js", "assets/javascripts/worker/search.js": "assets/javascripts/worker/search.fae956e7.min.js",

View File

@ -183,7 +183,7 @@
</div> </div>
{% block scripts %} {% block scripts %}
<script src="{{ 'assets/javascripts/vendor.11f47dfd.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/vendor.11f47dfd.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.d23ec273.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/bundle.f0e39e8b.min.js' | url }}"></script>
{%- set translations = {} -%} {%- set translations = {} -%}
{%- for key in [ {%- for key in [
"clipboard.copy", "clipboard.copy",

View File

@ -23,7 +23,6 @@
import { EMPTY, Observable, noop, of } from "rxjs" import { EMPTY, Observable, noop, of } from "rxjs"
import { import {
concatMap, concatMap,
filter,
map, map,
skip, skip,
switchMap, switchMap,
@ -74,7 +73,6 @@ export function patchScripts(
els$ els$
.pipe( .pipe(
switchMap(els => of(...els)), switchMap(els => of(...els)),
filter(el => !!el.src || /(^|\/javascript)$/i.test(el.type)),
concatMap(el => { concatMap(el => {
const script = createElement("script") const script = createElement("script")
if (el.src) { if (el.src) {
@ -83,9 +81,7 @@ export function patchScripts(
/* Complete when script is loaded */ /* Complete when script is loaded */
return new Observable(observer => { return new Observable(observer => {
script.onload = () => { script.onload = () => observer.complete()
observer.complete()
}
}) })
/* Complete immediately */ /* Complete immediately */