We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 934f8f6 commit 00d513eCopy full SHA for 00d513e
apps/sim/app/workspace/[workspaceId]/files/files.tsx
@@ -476,10 +476,11 @@ export function Files() {
476
}, [closeListContextMenu])
477
478
useEffect(() => {
479
- if (justCreatedFileIdRef.current && selectedFileId !== justCreatedFileIdRef.current) {
+ const isJustCreated = selectedFileId != null && justCreatedFileIdRef.current === selectedFileId
480
+ if (justCreatedFileIdRef.current && !isJustCreated) {
481
justCreatedFileIdRef.current = null
482
}
- setShowPreview(true)
483
+ setShowPreview(!isJustCreated)
484
}, [selectedFileId])
485
486
0 commit comments