diff --git a/src/Explorer/Controls/Settings/SettingsComponent.tsx b/src/Explorer/Controls/Settings/SettingsComponent.tsx index 7f4f8c64b..2121d9e27 100644 --- a/src/Explorer/Controls/Settings/SettingsComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsComponent.tsx @@ -149,7 +149,7 @@ export class SettingsComponent extends React.Component { @@ -561,21 +566,24 @@ export class SettingsComponent extends React.Component { + const baselineValues = this.getBaselineValues(); + this.setState(baselineValues as SettingsComponentState); + }; + + private getBaselineValues = (): Partial => { const offerThroughput = this.offer?.manualThroughput; if (!this.isCollectionSettingsTab) { - this.setState({ + return { throughput: offerThroughput, throughputBaseline: offerThroughput, - }); - - return; + }; } const defaultTtl = this.collection.defaultTtl(); - let timeToLive: TtlType = this.state.timeToLive; - let timeToLiveSeconds = this.state.timeToLiveSeconds; + let timeToLive: TtlType; + let timeToLiveSeconds: number; switch (defaultTtl) { case undefined: case 0: @@ -620,7 +628,7 @@ export class SettingsComponent extends React.Component {