From 398185dac01c8549b86d741ed3fdce6698d13f79 Mon Sep 17 00:00:00 2001 From: talksik Date: Sat, 1 Jan 2022 19:18:39 -0800 Subject: [PATCH] fixing bug to show my own icon in the convo bubble --- nirvana-ios/Services/AuthSessionStore.swift | 2 ++ .../Views/Convos/ConvoFooterView.swift | 2 +- .../Views/InnerCircle/CircleGridView.swift | 36 +++++++++---------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/nirvana-ios/Services/AuthSessionStore.swift b/nirvana-ios/Services/AuthSessionStore.swift index cbc2740..fb493a6 100644 --- a/nirvana-ios/Services/AuthSessionStore.swift +++ b/nirvana-ios/Services/AuthSessionStore.swift @@ -227,6 +227,8 @@ extension AuthSessionStore { print("up to date user: \(realtimeUpdatedUser)") self?.user = realtimeUpdatedUser self?.objectWillChange.send() + + self?.relevantUsersDict[currUserId!] = realtimeUpdatedUser } } diff --git a/nirvana-ios/Views/Convos/ConvoFooterView.swift b/nirvana-ios/Views/Convos/ConvoFooterView.swift index 03fa1b7..d43499e 100644 --- a/nirvana-ios/Views/Convos/ConvoFooterView.swift +++ b/nirvana-ios/Views/Convos/ConvoFooterView.swift @@ -111,7 +111,7 @@ struct ConvoFooterView: View { x:0, y:self.convoVM.selectedConvoId == nil ? 150 : 0 ) - .onReceive(self.convoVM.$selectedConvoId) {newConvoId in + .onChange(of: self.convoVM.selectedConvoId) {newConvoId in // update meta data based on which convo was selected // reset the selected options to start fresh diff --git a/nirvana-ios/Views/InnerCircle/CircleGridView.swift b/nirvana-ios/Views/InnerCircle/CircleGridView.swift index 2cfdeb5..00d5112 100644 --- a/nirvana-ios/Views/InnerCircle/CircleGridView.swift +++ b/nirvana-ios/Views/InnerCircle/CircleGridView.swift @@ -94,23 +94,19 @@ struct CircleGridView: View { .shadow(color: Color.black.opacity(0.2), radius: 10, x: 0, y: 20) } - Text("\(convoUsers.count)") + // top right number or people in convo + Circle() + .frame(width: 20, height: 20) + .foregroundColor(Color.green) + .font(.title2) .padding(5) - .font(.caption) - .foregroundColor(Color.white) - .background(NirvanaColor.dimTeal) - .cornerRadius(100) - - - // ZStack(alignment: .bottom) { - // Color.clear - // - // Text("kev, sarth...") - // .foregroundColor(NirvanaColor.teal) - // .font(.caption) - // } + .overlay( + Text("\(convoUsers.count)") + .foregroundColor(Color.white) + .font(.caption2) + ) } - .scaleEffect(self.animateLiveConvos ? scale + 0.2 : scale) + .scaleEffect(scale) .padding(scale * 5) } // geometry reader .offset( @@ -137,11 +133,11 @@ struct CircleGridView: View { } } - .animation( - Animation.easeInOut(duration: self.convoVM.selectedConvoId == currConvo.id ? 2 : 4 - ).repeatForever(autoreverses: true), - value: self.animateLiveConvos - ) +// .animation( +// Animation.easeInOut(duration: 4).repeatForever(autoreverses: true), +// value: self.animateLiveConvos +// ) + .animation(Animation.spring()) } // active friends