Skip to content

Commit

Permalink
Merge branch 'master' into DHIS2-18262
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharmyn28 authored Nov 7, 2024
2 parents 8b7fd1b + 00d0b0a commit c57a394
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/dialog/DialogFirstLaunch.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ import buttonStyle from '../../styles/Button.module.css'
import warning from '../../styles/Warning.module.css'

const DialogFirstLaunch = ({ handleSave, isOutOfDate, disable }) => {
const { baseUrl } = useConfig()
const { baseUrl, apiVersion } = useConfig()
const path = '/dhis-web-commons-about/redirect.action'
const initialUrl = `${baseUrl}${path}`
const maxApiVersion = 42
const redirectUrl = apiVersion >= maxApiVersion ? baseUrl : initialUrl

return (
<Modal position="middle">
Expand Down Expand Up @@ -61,7 +63,7 @@ const DialogFirstLaunch = ({ handleSave, isOutOfDate, disable }) => {
<ButtonStrip end>
<Button>
<a
href={initialUrl}
href={redirectUrl}
className={buttonStyle.button_redirect}
>
{i18n.t('Exit, do not apply settings')}
Expand Down

0 comments on commit c57a394

Please sign in to comment.