File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ final googleSignIn = new GoogleSignIn();
18
18
final ref = Firestore .instance.collection ('insta_users' );
19
19
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging ();
20
20
21
+
21
22
User currentUserModel;
22
23
23
24
Future <void > main () async {
24
25
await Firestore .instance.settings (timestampsInSnapshotsEnabled: true );
25
-
26
26
runApp (new Fluttergram ());
27
27
}
28
28
@@ -129,7 +129,7 @@ tryCreateUserRecord(BuildContext context) async {
129
129
"displayName" : user.displayName,
130
130
"bio" : "" ,
131
131
"followers" : {},
132
- "following" : {} ,
132
+ "following" : {user.id : true }, // add current user so they can see their own posts in feed ,
133
133
});
134
134
}
135
135
}
Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ class ProfilePage extends StatefulWidget {
13
13
_ProfilePage createState () => new _ProfilePage (this .userId);
14
14
}
15
15
16
- class _ProfilePage extends State <ProfilePage > with AutomaticKeepAliveClientMixin <ProfilePage > {
16
+ class _ProfilePage extends State <ProfilePage >
17
+ with AutomaticKeepAliveClientMixin <ProfilePage > {
17
18
final String profileId;
18
19
String currentUserId = googleSignIn.currentUser.id;
19
20
String view = "grid" ; // default view
@@ -398,6 +399,9 @@ class _ProfilePage extends State<ProfilePage> with AutomaticKeepAliveClientMixin
398
399
}
399
400
}
400
401
402
+ // hacky fix to enable a user's post to appear in their feed without skewing the follower/following count
403
+ if (followings[profileId] != null && followings[profileId]) count -= 1 ;
404
+
401
405
followings.forEach (countValues);
402
406
403
407
return count;
You can’t perform that action at this time.
0 commit comments