Skip to content

Commit

Permalink
Replace optional chaining with an early return
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmengo committed Oct 18, 2024
1 parent dbc775a commit f26565f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/theme/src/cli/utilities/theme-fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,14 @@ export function mountThemeFileSystem(root: string, options?: ThemeFileSystemOpti
const contentPromise = read(fileKey).then(async () => {
const file = files.get(fileKey)

if (file?.checksum !== previousChecksum) {
if (!file) return ''

if (file.checksum !== previousChecksum) {
// Sync only if the file has changed
unsyncedFileKeys.add(fileKey)
}

return file?.value ?? file?.attachment ?? ''
return file.value ?? file.attachment ?? ''
})

const syncPromise = contentPromise
Expand Down

0 comments on commit f26565f

Please sign in to comment.