chore: Hide homepage button if not preset

This commit is contained in:
Christian Kußowski 2026-02-22 12:31:35 +01:00
commit 9f5794004e
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -91,6 +91,7 @@ class SignInPage extends StatelessWidget {
itemCount: publicHomeservers.length, itemCount: publicHomeservers.length,
itemBuilder: (context, i) { itemBuilder: (context, i) {
final server = publicHomeservers[i]; final server = publicHomeservers[i];
final homepage = server.homepage;
return RadioListTile.adaptive( return RadioListTile.adaptive(
value: server, value: server,
radioScaleFactor: radioScaleFactor:
@ -104,6 +105,7 @@ class SignInPage extends StatelessWidget {
title: Row( title: Row(
children: [ children: [
Expanded(child: Text(server.name ?? 'Unknown')), Expanded(child: Text(server.name ?? 'Unknown')),
if (homepage != null)
SizedBox.square( SizedBox.square(
dimension: 32, dimension: 32,
child: IconButton( child: IconButton(
@ -111,10 +113,8 @@ class SignInPage extends StatelessWidget {
Icons.open_in_new_outlined, Icons.open_in_new_outlined,
size: 16, size: 16,
), ),
onPressed: () => launchUrlString( onPressed: () =>
server.homepage ?? launchUrlString(homepage),
'https://${server.name}',
),
), ),
), ),
], ],