messaging works...hell ya

This commit is contained in:
talksik
2021-12-22 05:36:43 -08:00
parent 3b8041a17d
commit e4b5e5959b
2 changed files with 7 additions and 7 deletions
@@ -150,9 +150,9 @@ class FirestoreService {
do { do {
let _ = try db.collection(Collection.messages.rawValue).addDocument(from: message) let _ = try db.collection(Collection.messages.rawValue).addDocument(from: message)
completion(ServiceState.success("user created")) completion(ServiceState.success("message created"))
} catch { } catch {
print("error in updating user \(error.localizedDescription)") print("error in creating message \(error.localizedDescription)")
completion(ServiceState.error(ServiceError(description: error.localizedDescription))) completion(ServiceState.error(ServiceError(description: error.localizedDescription)))
} }
} }
@@ -73,13 +73,13 @@ class InnerCircleViewModel: ObservableObject {
// create a new message in firestore with the url for receiving user to automatically get notified // create a new message in firestore with the url for receiving user to automatically get notified
self?.firestoreService.createMessage(message: newMessage) {[weak self] res in self?.firestoreService.createMessage(message: newMessage) {[weak self] res in
print(res) print(res)
// delete local audio file from user's phone so that it doesn't get crazy
print("stopped recording: file about to get deleted from \(self?.getTemporaryDirectory()) with filename: \(self?.audioLocalUrl)")
try? FileManager.default.removeItem(at: (self?.audioLocalUrl)!)
} }
} }
// delete local audio file from user's phone so that it doesn't get crazy
print("stopped recording: file about to get deleted from \(getTemporaryDirectory()) with filename: \(self.audioLocalUrl)")
try? FileManager.default.removeItem(at: self.audioLocalUrl!)
} }
} }