diff --git a/src/features/Endpoint/Endpoint.tsx b/src/features/Endpoint/Endpoint.tsx
index d78d43b37..23d82bc0e 100644
--- a/src/features/Endpoint/Endpoint.tsx
+++ b/src/features/Endpoint/Endpoint.tsx
@@ -11,7 +11,7 @@ interface IEndpointFormValues {
}
const EndPoint = () => {
const default_endpoint = {
- app_id: getAppId(false),
+ app_id: getAppId(),
server_url: OAUTH_URL,
};
@@ -27,19 +27,20 @@ const EndPoint = () => {
},
});
+ const refreshWhenSubmitted = () => window.location.reload();
+
const onSubmit = (data: IEndpointFormValues) => {
localStorage.setItem('config.app_id', data.app_id);
localStorage.setItem('config.server_url', data.server_url);
+ refreshWhenSubmitted();
};
const onResetClicked = () => {
localStorage.removeItem('config.app_id');
localStorage.removeItem('config.server_url');
- window.location.reload();
+ refreshWhenSubmitted();
};
- const refreshWhenSubmitted = () => window.location.reload();
-
const server_url = localStorage.getItem('config.server_url') ?? default_endpoint.server_url;
const app_id = localStorage.getItem('config.app_id') ?? default_endpoint.app_id;
const current_url = `wss://${server_url}/websockets/v3?app_id=${app_id}&l=EN&brand=deriv`;
@@ -107,12 +108,7 @@ const EndPoint = () => {
{current_url}
-