Skip to content

Commit a1a17be

Browse files
committed
Improve UX around auto open-close body on Send page
1 parent b83145c commit a1a17be

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/components/send/request-pane.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,11 @@ export class RequestPane extends React.Component<{
6767
componentDidMount() {
6868
// Auto-collapse the body if you pick a body-less HTTP method
6969
disposeOnUnmount(this, reaction(() => this.props.requestInput.method, (method) => {
70-
// If there's a body entered, don't mess with it
71-
if (this.props.requestInput.rawBody.decoded.length > 0) return;
72-
7370
// If the body is empty, match the open/closed status to the method:
7471
if (METHODS_WITHOUT_BODY.includes(method)) {
75-
if (this.cardProps.requestBody.collapsed) return;
72+
// If there's a body entered, don't mess with it
73+
if (this.props.requestInput.rawBody.decoded.length > 0) return;
74+
else if (this.cardProps.requestBody.collapsed) return;
7675
else this.cardProps.requestBody.onCollapseToggled();
7776
} else {
7877
if (!this.cardProps.requestBody.collapsed) return;

0 commit comments

Comments
 (0)