Skip to content

Commit

Permalink
refactor(comments): simplify comments enabled check
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanwikner committed Dec 15, 2023
1 parent 25ffd11 commit a3dbcb0
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ export function useResolveCommentsEnabled(documentId: string, documentType: stri
[documentId, documentType, enabled],
)

const isEnabled = useMemo((): boolean => {
if (isLoading || !featureEnabled || !enabledFromConfig) return false
return true
}, [enabledFromConfig, featureEnabled, isLoading])
const isEnabled = !isLoading && featureEnabled && enabledFromConfig

return isEnabled
}

0 comments on commit a3dbcb0

Please sign in to comment.