Skip to content

Conversation

@adamraine
Copy link
Contributor

Sorry for the churn, we did have this option before #14388. However, the step flags object would completely override the flow flags even if there were settings defined on the flow flags that were not defined on the step flags.

This PR should handle the flow flags and step flags properly, by merging them together with step specific flags taking precedence.

@adamraine adamraine requested a review from a team as a code owner October 21, 2022 18:28
@adamraine adamraine requested review from connorjclark and removed request for a team October 21, 2022 18:28
*/
_getNextFlags(flags) {
const clonedFlowFlags = this._options?.flags && deepClone(this._options?.flags);
if (!flags) return clonedFlowFlags;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can this line be first?

Copy link
Contributor Author

@adamraine adamraine Oct 21, 2022

Choose a reason for hiding this comment

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

No, because then modifying the return value could affect the base flow flags when flags is undefined.

*/
_getNextNavigationFlags(flags) {
const newStepFlags = {...flags};
const newStepFlags = this._getNextFlags(flags) || {};
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: change name, or put || {} inside _getNextFlags

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted _getNextFlags to return undefined if undefined is passed in.

_getNextNavigationFlags will never return undefined because we ensure that skipAboutBlank is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants