feat: implement openExternalUrl utility for consistent external link handling

This commit is contained in:
2026-01-24 07:59:45 +11:00
parent c0af925420
commit a6b76a9be7
5 changed files with 29 additions and 12 deletions

View File

@@ -1,3 +1,4 @@
import { openExternalUrl } from '../../utils/tauri';
import { Box, Button, color, config, Dialog, Header, Icon, IconButton, Icons, Text } from 'folds';
import React, { useCallback, useEffect, useState } from 'react';
import { StageComponentProps } from './types';
@@ -20,8 +21,8 @@ export function SSOStage({
}, [submitAuthDict, session]);
const handleContinue = () => {
const w = window.open(ssoRedirectURL, '_blank');
setSSOWindow(w ?? undefined);
openExternalUrl(ssoRedirectURL);
setSSOWindow(undefined);
};
useEffect(() => {

View File

@@ -1,4 +1,5 @@
import React, { MouseEventHandler, useCallback, useMemo, useState } from 'react';
import { openExternalUrl } from '../../utils/tauri';
import { useNavigate } from 'react-router-dom';
import FocusTrap from 'focus-trap-react';
import { isKeyHotkey } from 'is-hotkey';
@@ -110,7 +111,7 @@ export function ServerChip({ server }: { server: string }) {
size="300"
radii="300"
onClick={() => {
window.open(`https://${server}`, '_blank');
openExternalUrl(`https://${server}`);
close();
}}
>