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(); 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});
}; };