Skip to content

Commit

Permalink
ADM-762: [frontend] refactor: make code easier to understand
Browse files Browse the repository at this point in the history
  • Loading branch information
JiangRu1 committed Feb 1, 2024
1 parent 40de27a commit 3fad76b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/src/context/Metrics/metricsSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ export const metricsSlice = createSlice({
},
addADeploymentFrequencySetting: (state) => {
const { deploymentFrequencySettings, importedData } = state;
const newId =
Math.max(
deploymentFrequencySettings[deploymentFrequencySettings.length - 1]?.id ?? 0,
importedData.importedDeployment[importedData.importedDeployment.length - 1]?.id ?? 0,
) + 1;
const maxId = Math.max(
deploymentFrequencySettings[deploymentFrequencySettings.length - 1]?.id ?? 0,
importedData.importedDeployment[importedData.importedDeployment.length - 1]?.id ?? 0,
);
const newId = maxId + 1;
state.deploymentFrequencySettings = [
...deploymentFrequencySettings,
{ id: newId, organization: '', pipelineName: '', step: '', branches: [] },
Expand Down

0 comments on commit 3fad76b

Please sign in to comment.