From 55e648742aa0abcadfd3df86fc1935f946cb1b78 Mon Sep 17 00:00:00 2001 From: Bruno D'Luka Date: Fri, 27 Oct 2023 18:19:38 -0300 Subject: [PATCH] fix: server adding --- lib/providers/update_provider.dart | 8 ++++---- lib/widgets/servers/add_server.dart | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/providers/update_provider.dart b/lib/providers/update_provider.dart index 97d08128..1cce149f 100644 --- a/lib/providers/update_provider.dart +++ b/lib/providers/update_provider.dart @@ -107,10 +107,10 @@ class UpdateManager extends ChangeNotifier { final currentVersion = Version.parse(packageInfo.version); final latestVersion = Version.parse(this.latestVersion!.version); - assert( - latestVersion >= currentVersion, - 'The latest version can not be older than the current version', - ); + // assert( + // latestVersion >= currentVersion, + // 'The latest version can not be older than the current version', + // ); return currentVersion != latestVersion; } diff --git a/lib/widgets/servers/add_server.dart b/lib/widgets/servers/add_server.dart index b47ba1e3..ae5e25d3 100644 --- a/lib/widgets/servers/add_server.dart +++ b/lib/widgets/servers/add_server.dart @@ -606,8 +606,13 @@ class _ConfigureDVRServerScreenState extends State { final name = nameController.text.trim(); final hostname = getServerHostname(hostnameController.text.trim()); - if (ServersProvider.instance.servers - .any((s) => Uri.parse(s.login).host == Uri.parse(hostname).host)) { + if (ServersProvider.instance.servers.any((s) { + final serverHost = Uri.parse(s.login).host; + final newServerHost = Uri.parse(hostname).host; + return serverHost.isNotEmpty && + newServerHost.isNotEmpty && + serverHost == newServerHost; + })) { showDialog( context: context, builder: (context) {