refactor: optimize codebase

This commit is contained in:
cogwheel0
2025-09-23 00:58:58 +05:30
parent 7ab1ec3acf
commit 41216ea432
10 changed files with 80 additions and 494 deletions

View File

@@ -126,10 +126,13 @@ final activeServerProvider = FutureProvider<ServerConfig?>((ref) async {
if (activeId == null || configs.isEmpty) return null;
return configs.firstWhere(
(config) => config.id == activeId,
orElse: () => configs.first,
);
for (final config in configs) {
if (config.id == activeId) {
return config;
}
}
return null;
});
final serverConnectionStateProvider = Provider<bool>((ref) {