Skip to content

Commit

Permalink
Clean up window resize flow
Browse files Browse the repository at this point in the history
  • Loading branch information
selinali2010 committed Feb 15, 2023
1 parent f2c2909 commit 1c8eb48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ import FrequencyResponseChart from './graph/FrequencyResponseChart';
import PresetsBar from './PresetsBar';

const AppContent = () => {
const { isGraphViewOn, isLoading, globalError, performHealthCheck } =
useAquaContext();
const { isLoading, globalError, performHealthCheck } = useAquaContext();

return (
<>
<SideBar />
<MainContent />
<PresetsBar />
{isGraphViewOn && <FrequencyResponseChart />}
<FrequencyResponseChart />
{globalError && (
<PrereqMissingModal
isLoading={isLoading}
Expand Down
7 changes: 6 additions & 1 deletion src/renderer/components/GraphViewSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ export default function GraphViewSwitch({ id }: IGraphViewSwitchProps) {
try {
if (isGraphViewOn) {
await disableGraphView();

// Reduce window size before allowing parametric components to fill space
await decreaseWindowSize();
setGraphViewOn(!isGraphViewOn);
} else {
await enableGraphView();

// Set parametric components to a fixed height before increasing window size
setGraphViewOn(!isGraphViewOn);
await increaseWindowSize();
}
setGraphViewOn(!isGraphViewOn);
} catch (e) {
setGlobalError(e as ErrorDescription);
}
Expand Down

0 comments on commit 1c8eb48

Please sign in to comment.