1
Fork 0

Save new user labels so their assigned IDs exist in storage.

This commit is contained in:
Bauke 2023-11-02 12:16:39 +01:00
parent cd00821c47
commit 459352f173
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 9 additions and 9 deletions

View File

@ -58,15 +58,15 @@ class App extends Component<Props, State> {
);
const id = await newUserLabelId();
userLabels.push(
await createValueUserLabel({
color: "#ff00ff",
id,
priority: 0,
text: "New Label",
username: existingUserLabel?.value.username ?? newLabelUsername,
}),
);
const userLabel = await createValueUserLabel({
color: "#ff00ff",
id,
priority: 0,
text: "New Label",
username: existingUserLabel?.value.username ?? newLabelUsername,
});
await userLabel.save();
userLabels.push(userLabel);
unsavedUserLabelIds.add(id);
this.setState({unsavedUserLabelIds, userLabels});
};