wip
This commit is contained in:
@@ -5,7 +5,7 @@ import { LoginPrompt } from './components/LoginPrompt';
|
||||
import { BrowserModeToggle } from './components/BrowserModeToggle';
|
||||
import { CheckoutConfirmationDialog } from './components/CheckoutConfirmationDialog';
|
||||
import { RaceCreationSuccessScreen } from './components/RaceCreationSuccessScreen';
|
||||
import type { HostedSessionConfig } from '../../../packages/domain/entities/HostedSessionConfig';
|
||||
import type { HostedSessionConfig } from '../../../packages/automation/domain/types/HostedSessionConfig';
|
||||
|
||||
interface SessionProgress {
|
||||
sessionId: string;
|
||||
@@ -138,7 +138,13 @@ export function App() {
|
||||
|
||||
const handleStartAutomation = async (config: HostedSessionConfig) => {
|
||||
setIsRunning(true);
|
||||
const result = await window.electronAPI.startAutomation(config);
|
||||
const result = await window.electronAPI.startAutomation(config) as {
|
||||
success: boolean;
|
||||
sessionId?: string;
|
||||
error?: string;
|
||||
authRequired?: boolean;
|
||||
authState?: AuthState;
|
||||
};
|
||||
|
||||
if (result.success && result.sessionId) {
|
||||
setSessionId(result.sessionId);
|
||||
@@ -147,8 +153,8 @@ export function App() {
|
||||
|
||||
setIsRunning(false);
|
||||
|
||||
if ((result as any).authRequired) {
|
||||
const nextAuthState = (result as any).authState as AuthState | undefined;
|
||||
if ('authRequired' in result && result.authRequired) {
|
||||
const nextAuthState = result.authState as AuthState | undefined;
|
||||
setAuthState(nextAuthState ?? 'EXPIRED');
|
||||
setAuthError(result.error ?? 'Authentication required before starting automation.');
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user