fix: never write undefined (#11)

Co-authored-by: naiba <hi@nai.ba>
This commit is contained in:
UUBulb
2024-11-30 15:04:00 +08:00
committed by GitHub
parent eb044d42bc
commit d1ac4fa5bd

View File

@@ -28,8 +28,8 @@ export const InstallCommandsMenu = forwardRef<HTMLButtonElement, ButtonProps>((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"), {