Skip to content

Commit

Permalink
fix truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagocarvalhodev committed Dec 3, 2024
1 parent 5c12fee commit ac24962
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/components/profile_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@ class _ProfileCardState extends State<ProfileCard> {
maxWidth = 100;
}

if (maxWidth > 180) {
maxWidth = 180;
if (maxWidth > 200) {
maxWidth = 200;
}
}

Expand Down
15 changes: 1 addition & 14 deletions lib/user/name/presentation/bloc/profile_name_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ class ProfileNameBloc extends Bloc<ProfileNameEvent, ProfileNameState> {
final primaryName =
await _arnsRepository.getPrimaryName(walletAddress, update: refresh);

final truncatedPrimaryName = _truncatePrimaryName(primaryName);

emit(
ProfileNameLoaded(truncatedPrimaryName, walletAddress),
);
emit(ProfileNameLoaded(primaryName, walletAddress));
} catch (e) {
if (e is PrimaryNameNotFoundException) {
logger.d('Primary name not found for address: $walletAddress');
Expand All @@ -63,13 +59,4 @@ class ProfileNameBloc extends Bloc<ProfileNameEvent, ProfileNameState> {
);
}
}

/// Truncates the primary name to 20 characters
String _truncatePrimaryName(String primaryName) {
if (primaryName.length > 20) {
return primaryName.substring(0, 20);
}

return primaryName;
}
}

0 comments on commit ac24962

Please sign in to comment.