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) { if (!copy) {
try { try {
setCopy(true); setCopy(true);
if (settings) if (config)
await navigator.clipboard.writeText(generateCommand(type, settings)); await navigator.clipboard.writeText(generateCommand(type, settings) || '');
} catch (e) { } catch (e) {
console.error(e); console.error(e);
toast(t("Error"), { toast(t("Error"), {