mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 07:18:38 +02:00
Various bugfix/cleanup (#489)
* parseCommands no longer removes excess whitespace (it was unneeded and also had a bug in it relating to commands that ended in a quote mark) * more documentation and some variable renaming * Fix script editor focus bug on navigating to the editor from sidebar * Fix initialization for lastNodeReset and lastAugReset
This commit is contained in:
@@ -131,12 +131,13 @@ export function Root(props: IProps): React.ReactElement {
|
||||
GetServer(openScripts[i].hostname) === null && openScripts.splice(i, 1);
|
||||
}
|
||||
if (currentScript && GetServer(currentScript.hostname) === null) {
|
||||
currentScript = openScripts[0];
|
||||
if (currentScript === undefined) currentScript = null;
|
||||
currentScript = openScripts[0] ?? null;
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (currentScript !== null) {
|
||||
const tabIndex = currentTabIndex();
|
||||
if (typeof tabIndex === "number") onTabClick(tabIndex);
|
||||
updateRAM(currentScript.code);
|
||||
}
|
||||
}, []);
|
||||
@@ -481,13 +482,7 @@ export function Root(props: IProps): React.ReactElement {
|
||||
}
|
||||
|
||||
function currentTabIndex(): number | undefined {
|
||||
if (currentScript !== null) {
|
||||
return openScripts.findIndex(
|
||||
(script) =>
|
||||
currentScript !== null && script.path === currentScript.path && script.hostname === currentScript.hostname,
|
||||
);
|
||||
}
|
||||
|
||||
if (currentScript) return openScripts.findIndex((openScript) => currentScript === openScript);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user