From fb56c79fe86966fecb620704590d575ba2851331 Mon Sep 17 00:00:00 2001 From: talksik Date: Sat, 25 Dec 2021 00:56:20 -0800 Subject: [PATCH] fixing issue of updating inbox users and the grid changing problem but need to still fix overall problem of ordering people consistently based on friend creation date --- nirvana-ios/Services/AuthSessionStore.swift | 6 ++++++ nirvana-ios/Views/InnerCircle/CircleGridView.swift | 5 +++-- nirvana-ios/Views/InnerCircle/InnerCircleView.swift | 9 +-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nirvana-ios/Services/AuthSessionStore.swift b/nirvana-ios/Services/AuthSessionStore.swift index 6e21284..b7b91c0 100644 --- a/nirvana-ios/Services/AuthSessionStore.swift +++ b/nirvana-ios/Services/AuthSessionStore.swift @@ -373,6 +373,10 @@ extension AuthSessionStore { } } + // listener for people who have me as an active friend might make inbox easier + // where friendId = me, isActive = true...this way it's a published property that can update the ui + // as inbox users is only being called on load + self.listenersActive = true // adding listeners to be able to deinit later @@ -398,6 +402,8 @@ extension AuthSessionStore { // transforming data to make it more valuable extension AuthSessionStore { func getActiveFriendIds() -> [String] { + // TODO: order friends by user friend creation date as dictionaries don't have any inherent order + // they order randomly through hash value creation var activeFriendIds: [String] = [] for (friendId, userFriend) in self.userFriendsDict { diff --git a/nirvana-ios/Views/InnerCircle/CircleGridView.swift b/nirvana-ios/Views/InnerCircle/CircleGridView.swift index 0f0de2f..cffd5f1 100644 --- a/nirvana-ios/Views/InnerCircle/CircleGridView.swift +++ b/nirvana-ios/Views/InnerCircle/CircleGridView.swift @@ -68,6 +68,7 @@ struct CircleGridView: View { // active friends ForEach(0..