feat: improve dashboard header controls#162
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8293365d65
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const AIRTABLE_STORAGE_KEY = 'omnipost.airtableEnabled'; | ||
|
|
||
| export function AirtableSection() { | ||
| const [enabled, setEnabled] = useState(true); |
There was a problem hiding this comment.
Avoid fetching Airtable when disabled
When omnipost.airtableEnabled is already stored as false, this initial true render still mounts <AirtableIntegration /> for the first commit. Its child useEffect can start the Airtable request before this component's effect reads localStorage and hides the panel, so a user who disabled the header control still spends an Airtable/API-key-backed fetch on every dashboard load. Initialize from storage before rendering the integration, or gate the panel until the stored preference has been loaded.
Useful? React with 👍 / 👎.
Summary
Validation
Notes