mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-22 06:02:26 +01:00
const openScripts (format)
This commit is contained in:
parent
57fa1b743a
commit
e6f9f9ed75
@ -136,8 +136,8 @@ export function Root(props: IProps): React.ReactElement {
|
|||||||
const [ramInfoOpen, setRamInfoOpen] = useState(false);
|
const [ramInfoOpen, setRamInfoOpen] = useState(false);
|
||||||
|
|
||||||
// Prevent Crash if script is open on deleted server
|
// Prevent Crash if script is open on deleted server
|
||||||
for (let i=openScripts.length-1;i>=0;i--){
|
for (let i = openScripts.length - 1; i >= 0; i--) {
|
||||||
GetServer(openScripts[i].hostname) === null && openScripts.splice(i,1);
|
GetServer(openScripts[i].hostname) === null && openScripts.splice(i, 1);
|
||||||
}
|
}
|
||||||
if (currentScript && GetServer(currentScript.hostname) === null) {
|
if (currentScript && GetServer(currentScript.hostname) === null) {
|
||||||
currentScript = openScripts[0];
|
currentScript = openScripts[0];
|
||||||
@ -673,7 +673,7 @@ export function Root(props: IProps): React.ReactElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Change current script if we closed it
|
// Change current script if we closed it
|
||||||
if(wasCurrentScript){
|
if (wasCurrentScript) {
|
||||||
//Keep the same index unless we were on the last script
|
//Keep the same index unless we were on the last script
|
||||||
const indexOffset = openScripts.length === index ? -1 : 0;
|
const indexOffset = openScripts.length === index ? -1 : 0;
|
||||||
currentScript = openScripts[index + indexOffset];
|
currentScript = openScripts[index + indexOffset];
|
||||||
|
Loading…
Reference in New Issue
Block a user