mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 09:43:54 +01:00
Merge pull request #241 from danielyxie/dev
Fix bug where sometimes Active Scripts UI wouldnt fully update after …
This commit is contained in:
commit
1df56cd76d
6
dist/engine.bundle.js
vendored
6
dist/engine.bundle.js
vendored
@ -18521,7 +18521,7 @@ function prestigeWorkerScripts() {
|
||||
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["deleteActiveScriptsItem"])(workerScripts[i]);
|
||||
workerScripts[i].env.stopFlag = true;
|
||||
}
|
||||
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["updateActiveScriptsItems"])(); //Force UI to update
|
||||
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["updateActiveScriptsItems"])(5000); //Force UI to update
|
||||
workerScripts.length = 0;
|
||||
}
|
||||
|
||||
@ -55109,10 +55109,10 @@ function deleteActiveScriptsItem(workerscript) {
|
||||
}
|
||||
|
||||
//Update the ActiveScriptsItems array
|
||||
function updateActiveScriptsItems() {
|
||||
function updateActiveScriptsItems(maxTasks=100) {
|
||||
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
|
||||
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
|
||||
let numTasks = Math.min(100, ActiveScriptsTasks.length);
|
||||
let numTasks = Math.min(maxTasks, ActiveScriptsTasks.length);
|
||||
for (let i = 0; i < numTasks; ++i) {
|
||||
let task = ActiveScriptsTasks.shift();
|
||||
try {
|
||||
|
6
dist/tests.bundle.js
vendored
6
dist/tests.bundle.js
vendored
@ -18521,7 +18521,7 @@ function prestigeWorkerScripts() {
|
||||
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["deleteActiveScriptsItem"])(workerScripts[i]);
|
||||
workerScripts[i].env.stopFlag = true;
|
||||
}
|
||||
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["updateActiveScriptsItems"])(); //Force UI to update
|
||||
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["updateActiveScriptsItems"])(5000); //Force UI to update
|
||||
workerScripts.length = 0;
|
||||
}
|
||||
|
||||
@ -55109,10 +55109,10 @@ function deleteActiveScriptsItem(workerscript) {
|
||||
}
|
||||
|
||||
//Update the ActiveScriptsItems array
|
||||
function updateActiveScriptsItems() {
|
||||
function updateActiveScriptsItems(maxTasks=100) {
|
||||
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
|
||||
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
|
||||
let numTasks = Math.min(100, ActiveScriptsTasks.length);
|
||||
let numTasks = Math.min(maxTasks, ActiveScriptsTasks.length);
|
||||
for (let i = 0; i < numTasks; ++i) {
|
||||
let task = ActiveScriptsTasks.shift();
|
||||
try {
|
||||
|
@ -182,10 +182,10 @@ function deleteActiveScriptsItem(workerscript) {
|
||||
}
|
||||
|
||||
//Update the ActiveScriptsItems array
|
||||
function updateActiveScriptsItems() {
|
||||
function updateActiveScriptsItems(maxTasks=100) {
|
||||
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
|
||||
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
|
||||
let numTasks = Math.min(100, ActiveScriptsTasks.length);
|
||||
let numTasks = Math.min(maxTasks, ActiveScriptsTasks.length);
|
||||
for (let i = 0; i < numTasks; ++i) {
|
||||
let task = ActiveScriptsTasks.shift();
|
||||
try {
|
||||
|
@ -53,7 +53,7 @@ function prestigeWorkerScripts() {
|
||||
deleteActiveScriptsItem(workerScripts[i]);
|
||||
workerScripts[i].env.stopFlag = true;
|
||||
}
|
||||
updateActiveScriptsItems(); //Force UI to update
|
||||
updateActiveScriptsItems(5000); //Force UI to update
|
||||
workerScripts.length = 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user