fix(ui): condition names to be unique
This commit is contained in:
parent
0a6efe933f
commit
fc7183e504
1 changed files with 8 additions and 0 deletions
|
|
@ -85,6 +85,14 @@ export default class SettingsStore {
|
|||
|
||||
updateCaptureConditions = (projectId: number, data: CaptureConditions) => {
|
||||
this.loadingCaptureRate = true;
|
||||
const duplicates = data.conditions.filter(
|
||||
(c, index) => data.conditions.findIndex((c2) => c2.name === c.name) !== index
|
||||
);
|
||||
if (duplicates.length > 0) {
|
||||
toast.error('Condition set names must be unique');
|
||||
this.loadingCaptureRate = false;
|
||||
return;
|
||||
}
|
||||
return sessionService
|
||||
.saveCaptureConditions(projectId, data)
|
||||
.then((data) => data.json())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue