mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 09:26:33 +01:00
Improve performance by half on WI book load
This commit is contained in:
parent
3523ec334d
commit
34767e5ce3
@ -1867,7 +1867,8 @@ function displayWorldEntries(name, data, navigation = navigation_option.none, fl
|
|||||||
Trigger %
|
Trigger %
|
||||||
</small>
|
</small>
|
||||||
</div>`;
|
</div>`;
|
||||||
const blocks = page.map(entry => getWorldEntry(name, data, entry)).filter(x => x);
|
const blocksPromises = page.map(async (entry) => await getWorldEntry(name, data, entry)).filter(x => x);
|
||||||
|
const blocks = await Promise.all(blocksPromises);
|
||||||
const isCustomOrder = $('#world_info_sort_order').find(':selected').data('rule') === 'custom';
|
const isCustomOrder = $('#world_info_sort_order').find(':selected').data('rule') === 'custom';
|
||||||
if (!isCustomOrder) {
|
if (!isCustomOrder) {
|
||||||
blocks.forEach(block => {
|
blocks.forEach(block => {
|
||||||
@ -2251,7 +2252,7 @@ function parseRegexFromString(input) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWorldEntry(name, data, entry) {
|
async function getWorldEntry(name, data, entry) {
|
||||||
if (!data.entries[entry.uid]) {
|
if (!data.entries[entry.uid]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user