From 87f6c9ebde952a8d226025e1b1d209ec4ad62dec Mon Sep 17 00:00:00 2001 From: risc Date: Mon, 2 Jun 2025 02:56:23 -0500 Subject: [PATCH] Display default password even if there isn't a default username (#4900) This fixes the display of the Deluge script. --- .../ScriptItems/DefaultPassword.tsx | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/scripts/_components/ScriptItems/DefaultPassword.tsx b/frontend/src/app/scripts/_components/ScriptItems/DefaultPassword.tsx index 5034bc939..8c5a3d00f 100644 --- a/frontend/src/app/scripts/_components/ScriptItems/DefaultPassword.tsx +++ b/frontend/src/app/scripts/_components/ScriptItems/DefaultPassword.tsx @@ -5,7 +5,7 @@ import { Script } from "@/lib/types"; export default function DefaultPassword({ item }: { item: Script }) { const { username, password } = item.default_credentials; - const hasDefaultLogin = username && password; + const hasDefaultLogin = username || password; if (!hasDefaultLogin) return null; @@ -23,14 +23,17 @@ export default function DefaultPassword({ item }: { item: Script }) {

You can use the following credentials to login to the {item.name} {item.type}.

- {["username", "password"].map((type) => ( -
- {type.charAt(0).toUpperCase() + type.slice(1)}:{" "} - -
- ))} + {["username", "password"].map((type) => { + const value = item.default_credentials[type as "username" | "password"]; + return value && value.trim() !== "" ? ( +
+ {type.charAt(0).toUpperCase() + type.slice(1)}:{" "} + +
+ ) : null; + })} );