Skip to content

Commit ef793c0

Browse files
authored
Merge pull request #284 from deriv-com/revert-283-mayuran/diel-access-blocked
Revert "fix: diel country block"
2 parents 50b22b0 + 7325662 commit ef793c0

File tree

9 files changed

+16
-112
lines changed

9 files changed

+16
-112
lines changed

i18n/en/code.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,7 @@
11751175
"Demo account": {
11761176
"message": "Demo account"
11771177
},
1178+
11781179
"Deriv.com": {
11791180
"message": "Deriv.com"
11801181
},
@@ -1192,14 +1193,5 @@
11921193
},
11931194
"Get real account": {
11941195
"message": "Get real account"
1195-
},
1196-
"Not available in your region": {
1197-
"message": "Not available in your region"
1198-
},
1199-
"You can still use our other products and services.": {
1200-
"message": "You can still use our other products and services."
1201-
},
1202-
"Go to home": {
1203-
"message": "Go to home"
12041196
}
12051197
}

i18n/fr/code.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"message": "Tableau de bord"
1313
},
1414
"API explorer": {
15-
"message": "API explorer"
15+
"message": "Explorateur d'API"
1616
},
1717
"Deriv Tech": {
1818
"message": "Deriv Tech"
@@ -1192,14 +1192,5 @@
11921192
},
11931193
"Get real account": {
11941194
"message": "Obtenir un compte réel"
1195-
},
1196-
"Not available in your region": {
1197-
"message": "N'est pas disponible dans votre région"
1198-
},
1199-
"You can still use our other products and services.": {
1200-
"message": "Vous pouvez toujours utiliser nos autres produits et services."
1201-
},
1202-
"Go to home": {
1203-
"message": "Rentrez à la page d'accueil"
12041195
}
12051196
}

src/contexts/app-manager/app-manager.context.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export type TAppManagerContext = {
2020
setIsDashboard: Dispatch<SetStateAction<boolean>>;
2121
app_register_modal_open: boolean;
2222
setAppRegisterModalOpen: Dispatch<SetStateAction<boolean>>;
23-
is_dashboard_blocked: boolean;
2423
};
2524

2625
export const AppManagerContext = createContext<TAppManagerContext | null>(null);

src/contexts/app-manager/app-manager.provider.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ const AppManagerContextProvider = ({ children }: TAppManagerContextProps) => {
1414
const [is_dashboard, setIsDashboard] = useState(false);
1515
const [app_register_modal_open, setAppRegisterModalOpen] = useState(false);
1616
const [current_updating_item, setCurrentUpdateItem] = useState({});
17-
const { getAllApps, apps: updatedApps, error } = useGetApps();
17+
const { getAllApps, apps: updatedApps } = useGetApps();
1818
const { is_authorized } = useAuthContext();
19-
const [is_dashboard_blocked, setIsDashboardBlocked] = useState(false);
2019

2120
const getApps = useCallback(() => {
2221
if (is_authorized) {
@@ -33,12 +32,6 @@ const AppManagerContextProvider = ({ children }: TAppManagerContextProps) => {
3332
}
3433
}, []);
3534

36-
useEffect(() => {
37-
if (error?.error?.code === 'AppList') {
38-
setIsDashboardBlocked(true);
39-
}
40-
}, [error]);
41-
4235
const handleCurrentUpdatingItem = useCallback((item: ApplicationObject) => {
4336
setCurrentUpdateItem(item);
4437
}, []);
@@ -59,7 +52,6 @@ const AppManagerContextProvider = ({ children }: TAppManagerContextProps) => {
5952
app_register_modal_open,
6053
handleCurrentUpdatingItem,
6154
current_updating_item,
62-
is_dashboard_blocked,
6355
};
6456
}, [
6557
apps,
@@ -72,7 +64,6 @@ const AppManagerContextProvider = ({ children }: TAppManagerContextProps) => {
7264
setAppRegisterModalOpen,
7365
handleCurrentUpdatingItem,
7466
current_updating_item,
75-
is_dashboard_blocked,
7667
]);
7768

7869
return <AppManagerContext.Provider value={context_object}>{children}</AppManagerContext.Provider>;

src/contexts/auth/auth.provider.tsx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,16 @@ const AuthProvider = ({ children }: TAuthProviderProps) => {
8181

8282
const updateAuthorize = useCallback(async () => {
8383
if (currentLoginAccount.token) {
84-
try {
85-
const { authorize } = await apiManager.authorize(
86-
currentLoginAccount.token,
87-
setIsConnected,
88-
setIsAuthorized,
89-
);
90-
setIsAuthorized(true);
91-
setisSwitchingAccount(false);
92-
const { account_list, ...user } = authorize;
93-
setUserAccounts(account_list);
94-
setUser(user);
95-
} catch (error) {
96-
console.error('Failed to authorize:', error);
97-
}
84+
const { authorize } = await apiManager.authorize(
85+
currentLoginAccount.token,
86+
setIsConnected,
87+
setIsAuthorized,
88+
);
89+
setIsAuthorized(true);
90+
setisSwitchingAccount(false);
91+
const { account_list, ...user } = authorize;
92+
setUserAccounts(account_list);
93+
setUser(user);
9894
}
9995
}, [currentLoginAccount.token, setUser, setUserAccounts]);
10096

src/features/dashboard/components/permission-denied-error/permission-denied-error.scss

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/features/dashboard/components/permission-denied-error/permission-denied-error.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/features/dashboard/dashboard.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import ManageDashboard from './manage-dashboard';
55
import { Login } from '../Login/Login';
66
import BrowserOnly from '@docusaurus/BrowserOnly';
77
import { Fallback } from '../Fallback';
8-
import PermissionDeniedError from './components/permission-denied-error/permission-denied-error';
98

109
const Dashboard = () => {
1110
const { is_logged_in, siteActive } = useAuthContext();
12-
const { setIsDashboard, is_dashboard_blocked } = useAppManager();
11+
const { setIsDashboard } = useAppManager();
1312

1413
useEffect(() => {
1514
setIsDashboard(true);
@@ -19,10 +18,6 @@ const Dashboard = () => {
1918
}, [setIsDashboard]);
2019

2120
if (!siteActive) return <Fallback />;
22-
23-
// Show permission denied error if the flag is set
24-
if (is_logged_in && is_dashboard_blocked) return <PermissionDeniedError />;
25-
2621
if (is_logged_in) return <ManageDashboard />;
2722
return <BrowserOnly>{() => <Login />}</BrowserOnly>;
2823
};

src/features/dashboard/hooks/useGetApp/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import useWS from '@site/src/hooks/useWs';
22
import { useCallback } from 'react';
33

44
const useGetApps = () => {
5-
const { send, data, is_loading, error } = useWS('app_list');
5+
const { send, data, is_loading } = useWS('app_list');
66

77
const getAllApps = useCallback(() => {
88
send();
99
}, [send]);
1010

11-
return { getAllApps, apps: data, is_loading, error };
11+
return { getAllApps, apps: data, is_loading };
1212
};
1313

1414
export default useGetApps;

0 commit comments

Comments
 (0)