Skip to content

Commit

Permalink
Nullish checks instead of specifically undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
thsparks committed Oct 25, 2024
1 parent dd38711 commit 371d763
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webapp/src/sidepanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class Sidepanel extends data.Component<SidepanelProps, SidepanelState> {
const shouldResize = pxt.BrowserUtils.isTabletSize() || this.props.tutorialSimSidebar;
if (shouldResize != this.state.shouldResize) {
let height = this.state.height;
if (shouldResize && this.state.height === undefined && this.state.lastResizeHeight !== undefined) {
if (shouldResize && !this.state.height && this.state.lastResizeHeight) {
height = this.state.lastResizeHeight;
}

Expand Down Expand Up @@ -219,7 +219,7 @@ export class Sidepanel extends data.Component<SidepanelProps, SidepanelState> {
this.props.tutorialSimSidebar && "tutorial-sim"
);

const editorSidebarHeight = this.state.shouldResize && this.state.height !== undefined ? `${this.state.height}px` : undefined; // Should we use this regardless of shouldResize?
const editorSidebarHeight = this.state.shouldResize && this.state.height ? `${this.state.height}px` : undefined;

const tutorialContainer = tutorialOptions ? <TutorialContainer
parent={parent}
Expand Down

0 comments on commit 371d763

Please sign in to comment.