trying to fix bugs
This commit is contained in:
@@ -10,6 +10,7 @@ import SwiftUI
|
|||||||
struct ConvoFooterView: View {
|
struct ConvoFooterView: View {
|
||||||
@EnvironmentObject var convoVM: ConvoViewModel
|
@EnvironmentObject var convoVM: ConvoViewModel
|
||||||
@EnvironmentObject var authSessionStore: AuthSessionStore
|
@EnvironmentObject var authSessionStore: AuthSessionStore
|
||||||
|
@EnvironmentObject var innerCircleVM: InnerCircleViewModel
|
||||||
|
|
||||||
@State private var convoRelativeTime = ""
|
@State private var convoRelativeTime = ""
|
||||||
@State private var selectedConvo: Convo? = nil
|
@State private var selectedConvo: Convo? = nil
|
||||||
@@ -94,8 +95,11 @@ struct ConvoFooterView: View {
|
|||||||
Button {
|
Button {
|
||||||
print("disconnecting user now ")
|
print("disconnecting user now ")
|
||||||
|
|
||||||
|
self.innerCircleVM.setupMessagingAudioSession()
|
||||||
|
|
||||||
self.convoVM.leaveConvo()
|
self.convoVM.leaveConvo()
|
||||||
|
|
||||||
|
|
||||||
// show success or failure toast
|
// show success or failure toast
|
||||||
} label: {
|
} label: {
|
||||||
Label("Call", systemImage: "powerplug.fill")
|
Label("Call", systemImage: "powerplug.fill")
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ struct CircleGridView: View {
|
|||||||
x: honeycombOffSetX(value),
|
x: honeycombOffSetX(value),
|
||||||
y: 0
|
y: 0
|
||||||
)
|
)
|
||||||
.id("\(value)") // id for scrollviewreader
|
// .id("\(value)") // id for scrollviewreader
|
||||||
.frame(height: Self.size)
|
.frame(height: Self.size)
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
// if not in a call already
|
// if not in a call already
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ struct InnerCircleView: View {
|
|||||||
|
|
||||||
ConvoFooterView()
|
ConvoFooterView()
|
||||||
.environmentObject(self.convoViewModel)
|
.environmentObject(self.convoViewModel)
|
||||||
|
.environmentObject(self.innerCircleVM)
|
||||||
}
|
}
|
||||||
.alert(self.alertText, isPresented: self.$alertActive) {
|
.alert(self.alertText, isPresented: self.$alertActive) {
|
||||||
|
|
||||||
|
|||||||
@@ -97,6 +97,13 @@ class InnerCircleViewModel: NSObject, ObservableObject {
|
|||||||
override init() {
|
override init() {
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
|
self.setupMessagingAudioSession()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// audio stuff
|
||||||
|
extension InnerCircleViewModel {
|
||||||
|
func setupMessagingAudioSession() {
|
||||||
// separate set up for listening vs recording
|
// separate set up for listening vs recording
|
||||||
do {
|
do {
|
||||||
try audioSession.setCategory(.playAndRecord, mode: .default, options: [.duckOthers, .allowBluetooth, .allowBluetoothA2DP])
|
try audioSession.setCategory(.playAndRecord, mode: .default, options: [.duckOthers, .allowBluetooth, .allowBluetoothA2DP])
|
||||||
@@ -108,10 +115,7 @@ class InnerCircleViewModel: NSObject, ObservableObject {
|
|||||||
print("Can not setup the Recording")
|
print("Can not setup the Recording")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// audio stuff
|
|
||||||
extension InnerCircleViewModel {
|
|
||||||
func startRecording() {
|
func startRecording() {
|
||||||
let filePath = getTemporaryDirectory().appendingPathComponent("\(UUID().uuidString).m4a")
|
let filePath = getTemporaryDirectory().appendingPathComponent("\(UUID().uuidString).m4a")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user