From 4a91a71891584a78b1222c0f8ccf9933f958655a Mon Sep 17 00:00:00 2001 From: catloversg <152669316+catloversg@users.noreply.github.com> Date: Tue, 28 Apr 2026 14:08:13 +0700 Subject: [PATCH] UI: Reload immediately after importing, deleting save data or killing all scripts (#2697) --- src/SaveObject.ts | 2 +- src/ui/GameRoot.tsx | 2 +- src/ui/React/DeleteGameButton.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SaveObject.ts b/src/SaveObject.ts index 4305fa4f9..2802a58f4 100644 --- a/src/SaveObject.ts +++ b/src/SaveObject.ts @@ -332,7 +332,7 @@ class BitburnerSaveObject implements BitburnerSaveObjectType { dialogBoxCreate(`Cannot import save data: ${error}`); return; } - setTimeout(() => location.reload(), 1000); + setTimeout(() => location.reload(), 0); } async getSaveDataFromFile(files: FileList | null): Promise { diff --git a/src/ui/GameRoot.tsx b/src/ui/GameRoot.tsx index 7d0157b41..709b143bc 100644 --- a/src/ui/GameRoot.tsx +++ b/src/ui/GameRoot.tsx @@ -224,7 +224,7 @@ export function GameRoot(): React.ReactElement { saveObject .saveGame() .then(() => { - setTimeout(() => htmlLocation.reload(), 2000); + setTimeout(() => htmlLocation.reload(), 0); }) .catch((error) => { exceptionAlert(error); diff --git a/src/ui/React/DeleteGameButton.tsx b/src/ui/React/DeleteGameButton.tsx index d5b13860b..ebc4d9e07 100644 --- a/src/ui/React/DeleteGameButton.tsx +++ b/src/ui/React/DeleteGameButton.tsx @@ -27,7 +27,7 @@ export function DeleteGameButton({ color = "primary" }: IProps): React.ReactElem deleteGame() .then(() => { pushDisableRestore(); - setTimeout(() => location.reload(), 1000); + setTimeout(() => location.reload(), 0); }) .catch((r) => console.error("Could not delete game: %o", r)); }}