From ca285822657d18f4413e5234eb9831be8da6ce7c Mon Sep 17 00:00:00 2001 From: phyzical Date: Wed, 16 Feb 2022 18:41:22 +0800 Subject: [PATCH] added logic to also check hostname for "current script" --- src/ScriptEditor/ui/ScriptEditorRoot.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ScriptEditor/ui/ScriptEditorRoot.tsx b/src/ScriptEditor/ui/ScriptEditorRoot.tsx index a53823671..79c5fe6b8 100644 --- a/src/ScriptEditor/ui/ScriptEditorRoot.tsx +++ b/src/ScriptEditor/ui/ScriptEditorRoot.tsx @@ -54,7 +54,7 @@ interface IProps { vim: boolean; } -// TODO: try to removve global symbols +// TODO: try to remove global symbols let symbolsLoaded = false; let symbols: string[] = []; export function SetupTextEditor(): void { @@ -777,12 +777,14 @@ export function Root(props: IProps): React.ReactElement { }} > {openScripts.map(({ fileName, hostname }, index) => { + const editingCurrentScript = currentScript?.fileName === openScripts[index].fileName && + currentScript?.hostname === openScripts[index].hostname const iconButtonStyle = { maxWidth: "25px", minWidth: "25px", minHeight: '38.5px', maxHeight: '38.5px', - ...(currentScript?.fileName === openScripts[index].fileName ? { + ...(editingCurrentScript ? { background: Settings.theme.button, borderColor: Settings.theme.button, color: Settings.theme.primary @@ -818,7 +820,7 @@ export function Root(props: IProps): React.ReactElement { if (e.button === 1) onTabClose(index); }} style={{ - ...(currentScript?.fileName === openScripts[index].fileName ? { + ...(editingCurrentScript ? { background: Settings.theme.button, borderColor: Settings.theme.button, color: Settings.theme.primary