Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check instructions length before setting option value #1196

Merged
merged 3 commits into from
Feb 21, 2025

Conversation

jamiebenstead
Copy link
Contributor

closes

I found that const option = instructions ? "instructions" : "file"; was always being set to true because it was receiving an empty array

Copy link
Contributor

@conorriches conorriches left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great spot!

let option = "file";
if (instructions.length > 0) {
option = "instructions";
}
Copy link
Contributor

@danhalson danhalson Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could make this a one liner again with

const option = instructions.length > 0 ? "instructions" : "file";

but happy with it either way 😄

Copy link
Contributor

@danhalson danhalson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as it's all fine, but added a suggestion which you can take or leave!

@jamiebenstead jamiebenstead merged commit a02d4da into main Feb 21, 2025
8 checks passed
@jamiebenstead jamiebenstead deleted the sidebar-bug-after-being-collapsed branch February 21, 2025 11:19
@jamiebenstead jamiebenstead mentioned this pull request Feb 21, 2025
jamiebenstead added a commit that referenced this pull request Feb 21, 2025
## What's Changed
* Check instructions length before setting option value by
@jamiebenstead in
#1196


**Full Changelog**:
v0.29.0...v0.29.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants