Skip to content

Commit

Permalink
ADM-762: [frontend] refactor: make code easier to understand (#1020)
Browse files Browse the repository at this point in the history
  • Loading branch information
JiangRu1 authored Feb 1, 2024
1 parent 40de27a commit a98efb5
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 a98efb5

Please sign in to comment.