Skip to content

Commit ac9f65b

Browse files
committed
fix(invite-modal): migrated invite modal to use tanstack query, updated biome config for lint, removed unused vars
1 parent 2c4eb9f commit ac9f65b

File tree

789 files changed

+2540
-3136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

789 files changed

+2540
-3136
lines changed

apps/sim/app/(auth)/components/social-login-buttons.tsx

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,8 @@ export function SocialLoginButtons({
3939
setIsGithubLoading(true)
4040
try {
4141
await client.signIn.social({ provider: 'github', callbackURL })
42-
} catch (err: any) {
43-
let errorMessage = 'Failed to sign in with GitHub'
44-
45-
if (err.message?.includes('account exists')) {
46-
errorMessage = 'An account with this email already exists. Please sign in instead.'
47-
} else if (err.message?.includes('cancelled')) {
48-
errorMessage = 'GitHub sign in was cancelled. Please try again.'
49-
} else if (err.message?.includes('network')) {
50-
errorMessage = 'Network error. Please check your connection and try again.'
51-
} else if (err.message?.includes('rate limit')) {
52-
errorMessage = 'Too many attempts. Please try again later.'
53-
}
42+
} catch (_err: unknown) {
43+
// Error handling is done silently - user will see the OAuth error page if needed
5444
} finally {
5545
setIsGithubLoading(false)
5646
}
@@ -62,18 +52,8 @@ export function SocialLoginButtons({
6252
setIsGoogleLoading(true)
6353
try {
6454
await client.signIn.social({ provider: 'google', callbackURL })
65-
} catch (err: any) {
66-
let errorMessage = 'Failed to sign in with Google'
67-
68-
if (err.message?.includes('account exists')) {
69-
errorMessage = 'An account with this email already exists. Please sign in instead.'
70-
} else if (err.message?.includes('cancelled')) {
71-
errorMessage = 'Google sign in was cancelled. Please try again.'
72-
} else if (err.message?.includes('network')) {
73-
errorMessage = 'Network error. Please check your connection and try again.'
74-
} else if (err.message?.includes('rate limit')) {
75-
errorMessage = 'Too many attempts. Please try again later.'
76-
}
55+
} catch (_err: unknown) {
56+
// Error handling is done silently - user will see the OAuth error page if needed
7757
} finally {
7858
setIsGoogleLoading(false)
7959
}

apps/sim/app/(auth)/login/login-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export default function LoginPage({
158158
return () => {
159159
window.removeEventListener('keydown', handleKeyDown)
160160
}
161-
}, [forgotPasswordEmail, forgotPasswordOpen])
161+
}, [forgotPasswordOpen])
162162

163163
const handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {
164164
const newEmail = e.target.value

apps/sim/app/(auth)/sso/sso-form.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { useEffect, useState } from 'react'
44
import { createLogger } from '@sim/logger'
55
import Link from 'next/link'
6-
import { useRouter, useSearchParams } from 'next/navigation'
6+
import { useSearchParams } from 'next/navigation'
77
import { Button } from '@/components/ui/button'
88
import { Input } from '@/components/ui/input'
99
import { Label } from '@/components/ui/label'
@@ -52,7 +52,6 @@ const validateCallbackUrl = (url: string): boolean => {
5252
}
5353

5454
export default function SSOForm() {
55-
const router = useRouter()
5655
const searchParams = useSearchParams()
5756
const [isLoading, setIsLoading] = useState(false)
5857
const [email, setEmail] = useState('')

apps/sim/app/(auth)/verify/use-verification.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export function useVerification({
196196

197197
return () => clearTimeout(timeoutId)
198198
}
199-
}, [otp, email, isLoading, isVerified])
199+
}, [otp, email, isLoading, isVerified, verifyCode])
200200

201201
useEffect(() => {
202202
if (typeof window !== 'undefined') {
@@ -220,7 +220,7 @@ export function useVerification({
220220
handleRedirect()
221221
}
222222
}
223-
}, [isEmailVerificationEnabled, router, isInviteFlow, redirectUrl])
223+
}, [isEmailVerificationEnabled, router, isInviteFlow, redirectUrl, refetchSession])
224224

225225
return {
226226
otp,

apps/sim/app/(landing)/components/hero/components/landing-canvas/dot-pattern.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export function DotPattern({
118118
<stop offset='100%' stopColor='currentColor' stopOpacity='0' />
119119
</radialGradient>
120120
</defs>
121-
{dots.map((dot, index) => (
121+
{dots.map((dot, _index) => (
122122
<circle
123123
key={`${dot.x}-${dot.y}`}
124124
cx={dot.x}

apps/sim/app/(landing)/components/hero/components/landing-canvas/landing-flow.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,8 @@ export function LandingFlow({
106106
proOptions={{ hideAttribution: true }}
107107
fitView={false}
108108
defaultViewport={{ x: 0, y: 0, zoom: 1 }}
109-
onInit={(instance) => {
109+
onInit={() => {
110110
setRfReady(true)
111-
// Expose limited viewport API for outer timeline to pan smoothly
112111
viewportApiRef.current = {
113112
panTo: (x: number, y: number, options?: { duration?: number }) => {
114113
setViewport({ x, y, zoom: 1 }, { duration: options?.duration ?? 0 })

apps/sim/app/(landing)/components/hero/hero.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export default function Hero() {
140140
*/
141141
const [rfNodes, setRfNodes] = React.useState<Node[]>([])
142142
const [rfEdges, setRfEdges] = React.useState<Edge[]>([])
143-
const [groupBox, setGroupBox] = React.useState<LandingGroupData | null>(null)
143+
const [groupBox] = React.useState<LandingGroupData | null>(null)
144144
const [worldWidth, setWorldWidth] = React.useState<number>(1000)
145145
const viewportApiRef = React.useRef<LandingViewportApi | null>(null)
146146

apps/sim/app/api/a2a/serve/[agentId]/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export function extractAgentContent(executeResult: {
149149
if (typeof executeResult.output === 'object' && executeResult.output !== null) {
150150
const keys = Object.keys(executeResult.output)
151151
// Skip empty objects or objects with only undefined values
152-
if (keys.length > 0 && keys.some((k) => executeResult.output![k] !== undefined)) {
152+
if (keys.length > 0 && keys.some((k) => executeResult.output?.[k] !== undefined)) {
153153
return JSON.stringify(executeResult.output)
154154
}
155155
}

apps/sim/app/api/auth/oauth/connections/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface GoogleIdToken {
1919
/**
2020
* Get all OAuth connections for the current user
2121
*/
22-
export async function GET(request: NextRequest) {
22+
export async function GET(_request: NextRequest) {
2323
const requestId = generateRequestId()
2424

2525
try {

apps/sim/app/api/auth/oauth/token/route.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ describe('OAuth Token API Routes', () => {
177177
const { POST } = await import('@/app/api/auth/oauth/token/route')
178178

179179
const response = await POST(req)
180-
const data = await response.json()
181180

182181
expect(response.status).toBe(403)
183182
})

0 commit comments

Comments
 (0)