Skip to content

Commit 3207484

Browse files
authored
Merge pull request #2754 from humanprotocol/develop
Release fix #2753
2 parents a48667f + f8e31ec commit 3207484

File tree

3 files changed

+32
-34
lines changed

3 files changed

+32
-34
lines changed

packages/apps/human-app/frontend/src/api/services/worker/oracles.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,22 @@ export async function getOracles({
3737
signal: AbortSignal;
3838
}) {
3939
let oracles = [H_CAPTCHA_ORACLE];
40-
const queryParams = selected_job_types.length
41-
? `?${stringifyUrlQueryObject({ selected_job_types })}`
42-
: '';
40+
if (env.VITE_FEATURE_FLAG_JOBS_DISCOVERY) {
41+
const queryParams = selected_job_types.length
42+
? `?${stringifyUrlQueryObject({ selected_job_types })}`
43+
: '';
4344

44-
const result = await apiClient(
45-
`${apiPaths.worker.oracles.path}${queryParams}`,
46-
{
47-
successSchema: OraclesSuccessSchema,
48-
options: { method: 'GET' },
49-
},
50-
signal
51-
);
52-
53-
oracles = oracles.concat(result);
45+
const result = await apiClient(
46+
`${apiPaths.worker.oracles.path}${queryParams}`,
47+
{
48+
successSchema: OraclesSuccessSchema,
49+
options: { method: 'GET' },
50+
},
51+
signal
52+
);
5453

54+
oracles = oracles.concat(result);
55+
}
5556
return oracles;
5657
}
5758

packages/apps/human-app/frontend/src/components/layout/drawer-menu-items/drawer-menu-items-worker.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,21 @@ import type {
55
} from '@/components/layout/protected/drawer-navigation';
66
import { HelpIcon, UserOutlinedIcon, WorkIcon } from '@/components/ui/icons';
77
import { routerPaths } from '@/router/router-paths';
8-
import { env } from '@/shared/env';
98
import { DarkModeSwitch } from '@/components/ui/dark-mode-switch';
109
import type { UserData } from '@/auth/auth-context';
1110

1211
export const workerDrawerTopMenuItems = (
1312
user: UserData | null
1413
): TopMenuItem[] => {
1514
return [
16-
...(env.VITE_FEATURE_FLAG_JOBS_DISCOVERY
17-
? [
18-
{
19-
label: t('components.DrawerNavigation.jobs'),
20-
icon: <WorkIcon />,
21-
link: routerPaths.worker.jobsDiscovery,
22-
disabled: !user?.wallet_address || user.kyc_status !== 'approved',
23-
},
24-
]
25-
: []),
15+
...[
16+
{
17+
label: t('components.DrawerNavigation.jobs'),
18+
icon: <WorkIcon />,
19+
link: routerPaths.worker.jobsDiscovery,
20+
disabled: !user?.wallet_address || user.kyc_status !== 'approved',
21+
},
22+
],
2623
];
2724
};
2825

packages/apps/human-app/frontend/src/router/routes.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,18 @@ export const protectedRoutes: {
9090
headerText: t('protectedPagesHeaders.profile'),
9191
},
9292
},
93+
{
94+
routerProps: {
95+
path: routerPaths.worker.jobsDiscovery,
96+
element: <JobsDiscoveryPage />,
97+
},
98+
pageHeaderProps: {
99+
headerIcon: <HomepageWorkIcon />,
100+
headerText: t('protectedPagesHeaders.jobsDiscovery'),
101+
},
102+
},
93103
...(env.VITE_FEATURE_FLAG_JOBS_DISCOVERY
94104
? [
95-
{
96-
routerProps: {
97-
path: routerPaths.worker.jobsDiscovery,
98-
element: <JobsDiscoveryPage />,
99-
},
100-
pageHeaderProps: {
101-
headerIcon: <HomepageWorkIcon />,
102-
headerText: t('protectedPagesHeaders.jobsDiscovery'),
103-
},
104-
},
105105
{
106106
routerProps: {
107107
path: `${routerPaths.worker.jobs}/:address`,

0 commit comments

Comments
 (0)