Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 54c3e88

Browse files
authored
Merge pull request #241 from hubert-deriv/cannot_set_markup_demo
2 parents 9a0f6ec + c468033 commit 54c3e88

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/features/dashboard/components/Dialogs/UpdateAppDialog/index.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { ApplicationObject } from '@deriv/api-types';
88
import { RegisterAppDialogError } from '../RegisterAppDialogError';
99
import { scopesArrayToObject, scopesObjectToArray } from '@site/src/utils';
1010
import styles from './update-app-dialog.module.scss';
11-
import useAuthContext from '@site/src/hooks/useAuthContext';
1211

1312
interface IUpdateAppDialog {
1413
app: ApplicationObject;
@@ -17,7 +16,6 @@ interface IUpdateAppDialog {
1716

1817
const UpdateAppDialog = ({ app, onClose }: IUpdateAppDialog) => {
1918
const { send: updateApp, data, error, clear } = useWS('app_update');
20-
const { currentLoginAccount } = useAuthContext();
2119
const { getApps } = useAppManager();
2220

2321
const scopes = scopesArrayToObject(app.scopes);
@@ -46,11 +44,10 @@ const UpdateAppDialog = ({ app, onClose }: IUpdateAppDialog) => {
4644
const onSubmit = useCallback(
4745
(data: IRegisterAppForm) => {
4846
const { name, redirect_uri, verification_uri, app_markup_percentage } = data;
49-
const is_demo_account = currentLoginAccount.name.includes('VRTC');
5047

5148
const has_redirect_uri = redirect_uri !== '' && { redirect_uri };
5249
const has_verification_uri = verification_uri !== '' && { verification_uri };
53-
const can_have_markup = !is_demo_account && {
50+
const markup = {
5451
app_markup_percentage: Number(app_markup_percentage),
5552
};
5653

@@ -66,7 +63,7 @@ const UpdateAppDialog = ({ app, onClose }: IUpdateAppDialog) => {
6663
name,
6764
...has_redirect_uri,
6865
...has_verification_uri,
69-
...can_have_markup,
66+
...markup,
7067
scopes: selectedScopes,
7168
});
7269
},

src/features/dashboard/register-app/index.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,18 @@ import { scopesObjectToArray } from '@site/src/utils';
55
import { RegisterAppDialogError } from '../components/Dialogs/RegisterAppDialogError';
66
import { RegisterAppDialogSuccess } from '../components/Dialogs/RegisterAppDialogSuccess';
77
import { IRegisterAppForm } from '../types';
8-
import useAuthContext from '@site/src/hooks/useAuthContext';
98

109
const AppRegistration = () => {
1110
const { send: registerApp, error, clear, data } = useWS('app_register');
12-
const { currentLoginAccount } = useAuthContext();
1311
const [form_is_cleared, setFormIsCleared] = useState(false);
1412

1513
const onSubmit = useCallback(
1614
(data: IRegisterAppForm) => {
1715
const { name, redirect_uri, verification_uri, app_markup_percentage } = data;
18-
const is_demo_account = currentLoginAccount.name.includes('VRTC');
1916

2017
const has_redirect_uri = redirect_uri !== '' && { redirect_uri };
2118
const has_verification_uri = verification_uri !== '' && { verification_uri };
22-
const can_have_markup = !is_demo_account && {
19+
const markup = {
2320
app_markup_percentage: Number(app_markup_percentage),
2421
};
2522

@@ -34,7 +31,7 @@ const AppRegistration = () => {
3431
name,
3532
...has_redirect_uri,
3633
...has_verification_uri,
37-
...can_have_markup,
34+
...markup,
3835
scopes: selectedScopes,
3936
});
4037
setFormIsCleared(true);

0 commit comments

Comments
 (0)