Skip to content

Commit

Permalink
Run hooks unconditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathonherbert committed Jul 14, 2022
1 parent ea710e2 commit efd36b7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ts/components/Controls.tsx
Expand Up @@ -67,10 +67,6 @@ const Controls = <TPluginState extends IPluginState>({
setPluginState(store.getState());
}, []);

if (!pluginState) {
return null;
}
const { requestMatchesOnDocModified, debug } = selectPluginConfig(pluginState)
const { telemetryAdapter } = useContext(TelemetryContext);

const requestMatches = () => {
Expand Down Expand Up @@ -166,6 +162,12 @@ const Controls = <TPluginState extends IPluginState>({
);
};

if (!pluginState) {
return null;
}

const { requestMatchesOnDocModified, debug } = selectPluginConfig(pluginState)

return (
<>
<div className="Sidebar__header-container">
Expand Down

0 comments on commit efd36b7

Please sign in to comment.