Skip to content

Commit 7ca4af8

Browse files
committed
lint
1 parent 6259d7d commit 7ca4af8

4 files changed

Lines changed: 372 additions & 1088 deletions

File tree

apps/sim/app/workspace/[workspaceId]/settings/hooks/use-profile-picture-upload.ts

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,33 @@ export function useProfilePictureUpload({
5151
fileInputRef.current?.click()
5252
}, [])
5353

54-
const uploadFileToServer = useCallback(async (file: File): Promise<string> => {
55-
try {
56-
const formData = new FormData()
57-
formData.append('file', file)
58-
formData.append('context', context)
59-
60-
const response = await fetch('/api/files/upload', {
61-
method: 'POST',
62-
body: formData,
63-
})
64-
65-
if (!response.ok) {
66-
const errorData = await response.json().catch(() => ({ error: response.statusText }))
67-
throw new Error(errorData.error || `Failed to upload file: ${response.status}`)
54+
const uploadFileToServer = useCallback(
55+
async (file: File): Promise<string> => {
56+
try {
57+
const formData = new FormData()
58+
formData.append('file', file)
59+
formData.append('context', context)
60+
61+
const response = await fetch('/api/files/upload', {
62+
method: 'POST',
63+
body: formData,
64+
})
65+
66+
if (!response.ok) {
67+
const errorData = await response.json().catch(() => ({ error: response.statusText }))
68+
throw new Error(errorData.error || `Failed to upload file: ${response.status}`)
69+
}
70+
71+
const data = await response.json()
72+
const publicUrl = data.fileInfo?.path || data.path || data.url
73+
logger.info(`Profile picture uploaded successfully via server upload: ${publicUrl}`)
74+
return publicUrl
75+
} catch (error) {
76+
throw new Error(error instanceof Error ? error.message : 'Failed to upload profile picture')
6877
}
69-
70-
const data = await response.json()
71-
const publicUrl = data.fileInfo?.path || data.path || data.url
72-
logger.info(`Profile picture uploaded successfully via server upload: ${publicUrl}`)
73-
return publicUrl
74-
} catch (error) {
75-
throw new Error(error instanceof Error ? error.message : 'Failed to upload profile picture')
76-
}
77-
}, [context])
78+
},
79+
[context]
80+
)
7881

7982
const processFile = useCallback(
8083
async (file: File) => {

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/workspace-header.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,9 @@ export function WorkspaceHeader({
373373
) : (
374374
<div
375375
className='flex h-[20px] w-[20px] flex-shrink-0 items-center justify-center rounded-sm font-medium text-caption text-white leading-none'
376-
style={{ backgroundColor: activeWorkspaceFull.color ?? 'var(--brand-accent)' }}
376+
style={{
377+
backgroundColor: activeWorkspaceFull.color ?? 'var(--brand-accent)',
378+
}}
377379
>
378380
{workspaceInitial}
379381
</div>

0 commit comments

Comments
 (0)