feat: implement openExternalUrl utility for consistent external link handling
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
@@ -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();
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user