From 0c6729fa75724beec5d375be61616f6ad41c8e10 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Thu, 10 Nov 2022 19:37:40 -0800 Subject: [PATCH] fix(ui): undefined reference in providers (#3618) under specific conditions, the provider details page will throw an uncaught exception caused by `useEffect` setting `name` to undefined when provider is undefined. use a placeholder instead of setting the field value directly. this also fixes the issue where an empty value is seens as a change, enabling save. --- ui/pages/providers/[id].js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ui/pages/providers/[id].js b/ui/pages/providers/[id].js index 19aff04338..356ae9de77 100644 --- a/ui/pages/providers/[id].js +++ b/ui/pages/providers/[id].js @@ -119,10 +119,6 @@ export default function ProvidersEditDetails() { }, ] - useEffect(() => { - setName(provider?.name) - }, [provider]) - useEffect(() => { return clearTimer() }, []) @@ -298,6 +294,7 @@ export default function ProvidersEditDetails() { { if (e.key === 'Escape' || e.key === 'Esc') {