From b0750126ae93885d12aeeadbd168771bcd509145 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 17 Sep 2020 18:17:14 +0200 Subject: [PATCH] Add rpc query on change (#3706) --- packages/apps/src/Endpoints/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/apps/src/Endpoints/index.tsx b/packages/apps/src/Endpoints/index.tsx index 32228e065c..5918799ebf 100644 --- a/packages/apps/src/Endpoints/index.tsx +++ b/packages/apps/src/Endpoints/index.tsx @@ -111,6 +111,7 @@ function Endpoints ({ className = '', offset, onClose }: Props): React.ReactElem const [groups, setGroups] = useState(combineEndpoints(linkOptions)); const [{ apiUrl, groupIndex, hasUrlChanged, isUrlValid }, setApiUrl] = useState(extractUrlState(uiSettings.get().apiUrl, groups)); const [storedCustomEndpoints, setStoredCustomEndpoints] = useState(getCustomEndpoints()); + const isKnownUrl = useMemo(() => { let result = false; @@ -192,7 +193,9 @@ function Endpoints ({ className = '', offset, onClose }: Props): React.ReactElem const _onApply = useCallback( (): void => { uiSettings.set({ ...(uiSettings.get()), apiUrl }); - window.location.reload(); + + window.location.assign(`${window.location.origin}${window.location.pathname}?rpc=${apiUrl}${window.location.hash}`); + // window.location.reload(); onClose(); },