Skip to content

Commit

Permalink
🩹 Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAlphamerc committed Feb 6, 2022
1 parent 833ed24 commit 607d03c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 4 additions & 2 deletions lib/model/notificationModel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class NotificationModel {
String? tweetKey;
String? updatedAt;
String? createdAt;
late String type;
late String? type;
Map<String, dynamic>? data;

NotificationModel({
Expand Down Expand Up @@ -36,5 +36,7 @@ class NotificationModel {
extension NotificationModelHelper on NotificationModel {
UserModel get user => UserModel.fromJson(data);

DateTime? get timeStamp => DateTime.tryParse(updatedAt ?? createdAt!);
DateTime? get timeStamp => updatedAt != null || createdAt != null
? DateTime.tryParse(updatedAt ?? createdAt!)
: null;
}
2 changes: 1 addition & 1 deletion lib/ui/page/feed/composeTweet/composeTweet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class _ComposeTweetReplyPageState extends State<ComposeTweetPage> {

/// Checks for username in tweet description
/// If foud sends notification to all tagged user
/// If no user found or not compost tweet screen is closed and redirect back to home page.
/// If no user found, compose tweet screen is closed and redirect back to home page.
await Provider.of<ComposeTweetState>(context, listen: false)
.sendNotification(
tweetModel, Provider.of<SearchState>(context, listen: false))
Expand Down
4 changes: 1 addition & 3 deletions lib/ui/page/feed/suggestedUsers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ class _SuggestedUsersState extends State<SuggestedUsers> {
await state.followUsers();
isLoading.value = false;
},
label: state.selectedusersCount < 5
? '${5 - state.selectedusersCount} more to follow'
: 'Follow ${state.selectedusersCount}',
label: 'Follow ${state.selectedusersCount}',
isWraped: true,
borderRadius: 50,
labelStyle: TextStyles.onPrimaryTitleText,
Expand Down
3 changes: 2 additions & 1 deletion lib/ui/page/homePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ class _HomePageState extends State<HomePage> {
final state = context.watch<AuthState>();
context.read<SuggestionsState>().initUser(state.userModel);

if (context.watch<SuggestionsState>().displaySuggestions) {
if (context
.select<SuggestionsState, bool>((state) => state.displaySuggestions)) {
return SuggestedUsers();
}

Expand Down

0 comments on commit 607d03c

Please sign in to comment.