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

fix: need to spread the object otherwise you loose the config #115

Closed
wants to merge 1 commit into from

Conversation

sfroment
Copy link
Member

We need to spread the object otherwise you'll loose the config assign before

@@ -38,7 +38,7 @@ export class TopologyNode {
};
}
if(!this._config.network_config?.tslog_config){
this._config.network_config = { tslog_config: this._config?.tslog_config };
this._config.network_config = { ...this._config.network_config, tslog_config: this._config?.tslog_config };
Copy link
Contributor

Choose a reason for hiding this comment

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

didn't noticed. what do you think its better?

this._config.network_config = { ...this._config.network_config, tslog_config: this._config?.tslog_config };

or

this._config.network_config.tslog_config = this._config?.tslog_config

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer the latest as we won't recreate the object, but there we can't as at this point in the code we don't know if this._config.network_config is not undefined, so we'll have to go for the 1st one if we aren't willing to add

 if (!this._config.network_config?.tslog_config) {
      if (!this._config.network_config) this._config.network_config = {};
      this._config.network_config.tslog_config = this._config?.tslog_config;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

We can go with it, all good

@d-roak
Copy link
Contributor

d-roak commented Aug 26, 2024

closing due to ts-log revert at #102 / #118

@d-roak d-roak closed this Aug 26, 2024
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.

2 participants