-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Desktop: Fixes #11833: Restore notebook from trash without requiring selection #11838
base: dev
Are you sure you want to change the base?
Conversation
…equiring selection (laurent22#11833)
Thank you for working on this! There's a failing test:
|
…sing whenClauseContextOptions
Based on a quick look through the code, this looks good to me! |
public commandToStatefulMenuItem(options: string|CommandToMenuItemOptions, ...args: any[]): MenuItem { | ||
let whenClauseContext, commandName; | ||
if (typeof options === 'string') { | ||
commandName = options; | ||
whenClauseContext = this.service.currentWhenClauseContext(); | ||
} else { | ||
commandName = options.commandName; | ||
const whenClauseContextOptions = options.whenClauseContextOptions; | ||
whenClauseContext = this.service.currentWhenClauseContext(whenClauseContextOptions); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of this. "options" which can be a string, the conditional, etc. It feels messy and it's in a place where code is already quite complex so it would be good to find a cleaner/clearer way to do this
What this PR does?
Issue Description
Root Cause
Issue resolution
Video
Before
before.mov
After
after.mov