Add rpc query on change (#3706)

This commit is contained in:
Jaco Greeff 2020-09-17 18:17:14 +02:00 committed by GitHub
parent 7ba7339d96
commit b0750126ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<UrlState>(extractUrlState(uiSettings.get().apiUrl, groups));
const [storedCustomEndpoints, setStoredCustomEndpoints] = useState<string[]>(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();
},