Skip to content

Commit a3c959e

Browse files
committed
fix(whitelabeling): blob preview dep cycle and missing color fallback
1 parent 516027e commit a3c959e

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ export function useProfilePictureUpload({
2727
const [isUploading, setIsUploading] = useState(false)
2828

2929
useEffect(() => {
30-
if (currentImage !== previewUrl) {
31-
if (previewRef.current && previewRef.current !== currentImage) {
32-
URL.revokeObjectURL(previewRef.current)
33-
previewRef.current = null
34-
}
35-
setPreviewUrl(currentImage || null)
30+
if (previewRef.current && previewRef.current !== currentImage) {
31+
URL.revokeObjectURL(previewRef.current)
32+
previewRef.current = null
3633
}
37-
}, [currentImage, previewUrl])
34+
setPreviewUrl(currentImage || null)
35+
}, [currentImage])
3836

3937
const validateFile = useCallback((file: File): string | null => {
4038
if (file.size > MAX_FILE_SIZE) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ export function WorkspaceHeader({
360360
{activeWorkspaceFull ? (
361361
<div
362362
className='flex h-[20px] w-[20px] flex-shrink-0 items-center justify-center rounded-sm font-medium text-caption text-white leading-none'
363-
style={{ backgroundColor: activeWorkspaceFull.color }}
363+
style={{ backgroundColor: activeWorkspaceFull.color ?? '#6b7280' }}
364364
>
365365
{workspaceInitial}
366366
</div>
@@ -406,7 +406,7 @@ export function WorkspaceHeader({
406406
{activeWorkspaceFull ? (
407407
<div
408408
className='flex h-[32px] w-[32px] flex-shrink-0 items-center justify-center rounded-md font-medium text-caption text-white'
409-
style={{ backgroundColor: activeWorkspaceFull.color }}
409+
style={{ backgroundColor: activeWorkspaceFull.color ?? '#6b7280' }}
410410
>
411411
{workspaceInitial}
412412
</div>
@@ -588,7 +588,7 @@ export function WorkspaceHeader({
588588
{activeWorkspaceFull ? (
589589
<div
590590
className='flex h-[20px] w-[20px] flex-shrink-0 items-center justify-center rounded-sm font-medium text-caption text-white leading-none'
591-
style={{ backgroundColor: activeWorkspaceFull.color }}
591+
style={{ backgroundColor: activeWorkspaceFull.color ?? '#6b7280' }}
592592
>
593593
{workspaceInitial}
594594
</div>

0 commit comments

Comments
 (0)