From 38b272d1f4d494dacf12df38e7a354f221924277 Mon Sep 17 00:00:00 2001 From: AmbrishRamachandiran Date: Mon, 31 Jul 2023 09:58:08 +0530 Subject: [PATCH] Limit the use of the same shortcut name and url when adding a shortcut with test cases Signed-off-by: AmbrishRamachandiran --- plugins/shortcuts/src/ShortcutForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/shortcuts/src/ShortcutForm.tsx b/plugins/shortcuts/src/ShortcutForm.tsx index 388d22596e..a23951c939 100644 --- a/plugins/shortcuts/src/ShortcutForm.tsx +++ b/plugins/shortcuts/src/ShortcutForm.tsx @@ -74,7 +74,7 @@ export const ShortcutForm = ({ }; const urlIsUnique = async (url: string) => { - if (shortcutApi.get().some(shortcutUrl => shortcutUrl.url === url)) + if (shortcutData.get().some(shortcutUrl => shortcutUrl.url === url)) return 'A shortcut with this url already exists'; return true; };