mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Tweak filter application to improve init speed
Schedule the filter application instead of running it immediately, and pre-initialise the lists, as this causes the UI to initialise faster, despite appearing like it should be slower.
This commit is contained in:
@@ -179,10 +179,15 @@
|
||||
appData.Filters.fillConflictsFilterList(appData.game.plugins);
|
||||
appData.filters.load(appData.settings.filters);
|
||||
|
||||
/* Initialise the lists before checking if any filters need to be applied.
|
||||
This causes the UI to be initialised faster thanks to scheduling
|
||||
behaviour. */
|
||||
dom.initialiseVirtualLists(appData.game.plugins);
|
||||
if (appData.filters.areAnyFiltersActive()) {
|
||||
appData.filters.apply(appData.game.plugins);
|
||||
} else {
|
||||
dom.initialiseVirtualLists(appData.game.plugins);
|
||||
/* Schedule applying the filters instead of applying them immediately.
|
||||
This improves the UI initialisation speed, and is quick enough that
|
||||
the lists aren't visible pre-filtration. */
|
||||
setTimeout(appData.filters.apply, 0, appData.game.plugins);
|
||||
}
|
||||
|
||||
Dialog.closeProgress();
|
||||
|
||||
Reference in New Issue
Block a user