Skip to content

Commit

Permalink
fix: clicking on the version link will open two duplicate browser win…
Browse files Browse the repository at this point in the history
…dows

Signed-off-by: 1111mp <The1111mp@outlook.com>
  • Loading branch information
1111mp committed Nov 22, 2024
1 parent 8352e43 commit 92796e5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/pages/versions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { Modal, type Ref as ModalRef } from './modal';
import dayjs from 'dayjs';
import localizedFormat from 'dayjs/plugin/localizedFormat';
import { useTranslation } from 'react-i18next';
import { open } from '@tauri-apps/plugin-shell';
import { useAppContext } from '@/app-context';
import {
vCurrent,
Expand Down Expand Up @@ -133,15 +134,20 @@ export const Versions: React.FC = () => {
<Tooltip>
<TooltipTrigger asChild>
<a
className='h-6 p-0 leading-6 text-md text-foreground font-medium hover:text-primary hover:underline'
href={`https://github.com/nodejs/node/releases/tag/${version}`}
target='_blank'
className='h-6 p-0 leading-6 text-md text-foreground font-medium cursor-pointer hover:text-primary hover:underline'
onClick={async () => {
await open(
`https://github.com/nodejs/node/releases/tag/${version}`
);
}}
>
{version}
</a>
</TooltipTrigger>
<TooltipPortal>
<TooltipContent>{t('Whats-new')}</TooltipContent>
<TooltipContent className='bg-primary'>
{t('Whats-new')}
</TooltipContent>
</TooltipPortal>
</Tooltip>
{lts ? (
Expand Down

0 comments on commit 92796e5

Please sign in to comment.