From d1ac4fa5bdf02bde4a54e38f305b46166abb44ec Mon Sep 17 00:00:00 2001 From: UUBulb <35923940+uubulb@users.noreply.github.com> Date: Sat, 30 Nov 2024 15:04:00 +0800 Subject: [PATCH] fix: never write undefined (#11) Co-authored-by: naiba --- src/components/install-commands.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/install-commands.tsx b/src/components/install-commands.tsx index 679e6eb..b3c3c41 100644 --- a/src/components/install-commands.tsx +++ b/src/components/install-commands.tsx @@ -28,8 +28,8 @@ export const InstallCommandsMenu = forwardRef((p if (!copy) { try { setCopy(true); - if (settings) - await navigator.clipboard.writeText(generateCommand(type, settings)); + if (config) + await navigator.clipboard.writeText(generateCommand(type, settings) || ''); } catch (e) { console.error(e); toast(t("Error"), {