From 2a2c3fe3779c71c46a7c2e55b55fa68202bcda3a Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Thu, 20 Jan 2022 08:50:00 +0200 Subject: [PATCH] Allow seed command with argument --- app/components/Layout/SearchInput.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/components/Layout/SearchInput.tsx b/app/components/Layout/SearchInput.tsx index 160d7119f..48589ef0a 100644 --- a/app/components/Layout/SearchInput.tsx +++ b/app/components/Layout/SearchInput.tsx @@ -13,20 +13,23 @@ export function SearchInputDev() { const handleEnter = () => { const [action, value] = inputValue.split(":"); - if (!action || !value) return; + if (!action) return; let fetchUrl = ""; switch (action) { case "liu": { + if (!value) return; fetchUrl = `/mock-auth?username=${encodeURIComponent(value)}`; break; } case "lit": { + if (!value) return; fetchUrl = `/mock-auth?team=${encodeURIComponent(value)}`; break; } case "seed": { - fetchUrl = `/seed?variation=${encodeURIComponent(value)}`; + if (!value) fetchUrl = "/seed"; + else fetchUrl = `/seed?variation=${encodeURIComponent(value)}`; break; } default: {