Skip to content

Commit

Permalink
Fix race condition when loading redirect/scriptlet resources
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Jun 26, 2024
1 parent 6b349ca commit 896737d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/js/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -1008,12 +1008,12 @@ onBroadcast(msg => {
ubolog('loadFilterLists() Start');
t0 = Date.now();
loadedListKeys.length = 0;
loadingPromise = Promise.all([
this.getAvailableLists().then(lists => onFilterListsReady(lists)),
this.loadRedirectResources().then(( ) => {
ubolog(`loadFilterLists() Redirects/scriptlets ready at ${elapsed()}`);
}),
]).then(( ) => {
loadingPromise = this.loadRedirectResources().then(( ) => {
ubolog(`loadFilterLists() Redirects/scriptlets ready at ${elapsed()}`);
return this.getAvailableLists();
}).then(lists => {
return onFilterListsReady(lists)
}).then(( ) => {
onDone();
});
return loadingPromise;
Expand Down

0 comments on commit 896737d

Please sign in to comment.