Save new user labels so their assigned IDs exist in storage.
This commit is contained in:
parent
cd00821c47
commit
459352f173
|
@ -58,15 +58,15 @@ class App extends Component<Props, State> {
|
||||||
);
|
);
|
||||||
|
|
||||||
const id = await newUserLabelId();
|
const id = await newUserLabelId();
|
||||||
userLabels.push(
|
const userLabel = await createValueUserLabel({
|
||||||
await createValueUserLabel({
|
color: "#ff00ff",
|
||||||
color: "#ff00ff",
|
id,
|
||||||
id,
|
priority: 0,
|
||||||
priority: 0,
|
text: "New Label",
|
||||||
text: "New Label",
|
username: existingUserLabel?.value.username ?? newLabelUsername,
|
||||||
username: existingUserLabel?.value.username ?? newLabelUsername,
|
});
|
||||||
}),
|
await userLabel.save();
|
||||||
);
|
userLabels.push(userLabel);
|
||||||
unsavedUserLabelIds.add(id);
|
unsavedUserLabelIds.add(id);
|
||||||
this.setState({unsavedUserLabelIds, userLabels});
|
this.setState({unsavedUserLabelIds, userLabels});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue