Conversation
8f414c2 to
8081f77
Compare
PR Review: Add feedback category resetting🟡 Code QualityNon-null assertion on nullable prop ( The prop type declares const res = await resetFeedbackCategory(activeGame.id, editingCategory\!.id, resetMode)Since the component is only rendered when a category is selected, the assertion holds in practice — but the type should reflect that invariant. Either tighten the prop type to // Option A: tighten the type
editingCategory: GameFeedbackCategory
// Option B: guard at the call site
if (\!editingCategory) return
const res = await resetFeedbackCategory(activeGame.id, editingCategory.id, resetMode)🔵 MinorDuplicated default reset mode ( The default mode const [resetMode, setResetMode] = useState<ResetMode>('dev')
...
defaultValue={resetModeOptions.find((option) => option.value === 'dev')}If the default ever changes, both must be updated in sync. A single constant eliminates the duplication: const DEFAULT_RESET_MODE: ResetMode = 'dev'
const [resetMode, setResetMode] = useState(DEFAULT_RESET_MODE)
...
defaultValue={resetModeOptions.find((option) => option.value === DEFAULT_RESET_MODE)}Inverted callback naming ( The |
No description provided.