Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen committed 2021-04-19 21:00:51 +03:00
1 parent 0f7acdaaab
commit b0e673e3b0
1 file changed
+2 -2
@@ -4,7 +4,7 @@ import { hotbarStore } from "../../../common/hotbar-store";
import { CommandOverlay } from "../command-palette"; import { CommandOverlay } from "../command-palette";
import { Input, InputValidator } from "../input"; import { Input, InputValidator } from "../input";
const uniqueWorkspaceName: InputValidator = { const uniqueHotbarName: InputValidator = {
condition: ({ required }) => required, condition: ({ required }) => required,
message: () => `Hotbar with this name already exists`, message: () => `Hotbar with this name already exists`,
validate: value => !hotbarStore.getByName(value), validate: value => !hotbarStore.getByName(value),
@@ -35,7 +35,7 @@ export class HotbarAddCommand extends React.Component {
autoFocus={true} autoFocus={true}
theme="round-black" theme="round-black"
data-test-id="command-palette-hotbar-add-name" data-test-id="command-palette-hotbar-add-name"
validators={[uniqueWorkspaceName]} validators={[uniqueHotbarName]}
onSubmit={(v) => this.onSubmit(v)} onSubmit={(v) => this.onSubmit(v)}
dirty={true} dirty={true}
showValidationLine={true} /> showValidationLine={true} />