fix: remoteIPaddress can't be null

This commit is contained in:
Siyuan 2025-11-05 15:21:14 +00:00
parent 7d2fe79993
commit d6d113e253
1 changed files with 2 additions and 3 deletions

View File

@ -129,9 +129,8 @@ export default function ConnectionStatsSidebar() {
</div> </div>
</GridCard> </GridCard>
<Button className="rounded-l-none border-l-slate-800/30 dark:border-slate-300/20" size="SM" type="button" theme="light" LeadingIcon={LuCopy} onClick={async () => { <Button className="rounded-l-none border-l-slate-800/30 dark:border-slate-300/20" size="SM" type="button" theme="light" LeadingIcon={LuCopy} onClick={async () => {
const ip = remoteIPAddress || ""; if (await copy(remoteIPAddress)) {
if (await copy(ip)) { notifications.success((m.connection_stats_remote_ip_address_copy_success({ ip: remoteIPAddress })));
notifications.success((m.connection_stats_remote_ip_address_copy_success({ ip })));
} else { } else {
notifications.error(m.connection_stats_remote_ip_address_copy_error()); notifications.error(m.connection_stats_remote_ip_address_copy_error());
} }