[READ ONLY MIRROR] Open Source TikTok alternative built on AT Protocol github.com/sprksocial/client
flutter atproto video dart
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

smooth brain issue (#73)

yeah

authored by

Jean Carlo Polo and committed by
GitHub
4aec58c8 2e949159

+14 -6
+14 -6
lib/src/core/network/atproto/data/repositories/actor_repository_impl.dart
··· 42 42 ); 43 43 return ProfileViewDetailed.fromJson(result.data as Map<String, dynamic>); 44 44 } catch (e) { 45 - _logger..e('Failed to retrieve profile for DID: $did', error: e) 46 - ..i('Trying to get profile from bluesky'); 45 + _logger 46 + ..e('Failed to retrieve profile for DID: $did', error: e) 47 + ..i('Trying to get profile from bluesky'); 47 48 final bluesky = bsky.Bluesky.fromSession(_client.authRepository.session!); 48 49 final profile = await bluesky.actor.getProfile(actor: did); 49 50 _logger.d('Profile retrieved successfully from bluesky'); ··· 195 196 196 197 @override 197 198 Future<List<ProfileViewDetailed>> getProfiles(List<String> dids) { 198 - _logger.d('Getting profiles for DIDs: $dids'); 199 199 return _client.executeWithRetry(() async { 200 + _logger.d('Getting profiles for DIDs: $dids'); 201 + if (dids.isEmpty) { 202 + _logger.w('No DIDs provided, returning empty list'); 203 + return <ProfileViewDetailed>[]; 204 + } 200 205 if (!_client.authRepository.isAuthenticated) { 201 206 _logger.w('Not authenticated'); 202 207 throw Exception('Not authenticated'); ··· 215 220 to: (jsonMap) => jsonMap, 216 221 adaptor: (uint8) => jsonDecode(utf8.decode(uint8 as List<int>)) as Map<String, dynamic>, 217 222 ); 218 - return (result.data['profiles']! as List).map((json) => ProfileViewDetailed.fromJson(json as Map<String, dynamic>)).toList(); 223 + return (result.data['profiles']! as List) 224 + .map((json) => ProfileViewDetailed.fromJson(json as Map<String, dynamic>)) 225 + .toList(); 219 226 } catch (e) { 220 - _logger..e('Failed to retrieve profile for DIDs: $dids', error: e) 221 - ..i('Trying to get profiles from bluesky'); 227 + _logger 228 + ..e('Failed to retrieve profile for DIDs: $dids', error: e) 229 + ..i('Trying to get profiles from bluesky'); 222 230 final bluesky = bsky.Bluesky.fromSession(_client.authRepository.session!); 223 231 final profiles = await bluesky.actor.getProfiles(actors: dids); 224 232 _logger.d('Profiles retrieved successfully from bluesky');