Skip to content

Commit

Permalink
fix: server adding
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlukaa committed Oct 27, 2023
1 parent fb8feab commit 55e6487
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/providers/update_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 7 additions & 2 deletions lib/widgets/servers/add_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,13 @@ class _ConfigureDVRServerScreenState extends State<ConfigureDVRServerScreen> {
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) {
Expand Down

0 comments on commit 55e6487

Please sign in to comment.