[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.

fix bsky profile (#67)

I thought this would be harder

authored by

Davi Rodrigues and committed by
GitHub
b7adcc8a b4c79261

+11 -12
+11 -12
lib/src/core/network/atproto/data/repositories/actor_repository_impl.dart
··· 32 32 _logger.e('AtProto not initialized'); 33 33 throw Exception('AtProto not initialized'); 34 34 } 35 - 36 - final result = await atproto.get( 37 - NSID.parse('so.sprk.actor.getProfile'), 38 - parameters: {'actor': did}, 39 - headers: {'atproto-proxy': _client.sprkDid}, 40 - to: (jsonMap) => jsonMap, 41 - adaptor: (uint8) => jsonDecode(utf8.decode(uint8)), 42 - ); 43 - if (result.status != HttpStatus.ok) { 44 - _logger.e('Failed to retrieve profile for DID: $did'); 35 + try { 36 + final result = await atproto.get( 37 + NSID.parse('so.sprk.actor.getProfile'), 38 + parameters: {'actor': did}, 39 + headers: {'atproto-proxy': _client.sprkDid}, 40 + to: (jsonMap) => jsonMap, 41 + adaptor: (uint8) => jsonDecode(utf8.decode(uint8)), 42 + ); 43 + return ProfileViewDetailed.fromJson(result.data as Map<String, dynamic>); 44 + } catch (e) { 45 + _logger.e('Failed to retrieve profile for DID: $did', error: e); 45 46 _logger.i('Trying to get profile from bluesky'); 46 47 final bluesky = Bluesky.fromSession(_client.authRepository.session!); 47 48 final profile = await bluesky.actor.getProfile(actor: did); 48 49 _logger.d('Profile retrieved successfully from bluesky'); 49 50 return ProfileViewDetailed.fromJson(profile.toJson()); 50 51 } 51 - _logger.d('Profile retrieved successfully'); 52 - return ProfileViewDetailed.fromJson(result.data as Map<String, dynamic>); 53 52 }); 54 53 } 55 54