adding data listening, user getching and using more of recoil

This commit is contained in:
Arjun Patel
2022-02-03 17:14:22 -08:00
parent 4b65d6cd68
commit 6a6f0f4aef
20 changed files with 302 additions and 517 deletions
+15 -5
View File
@@ -6,16 +6,26 @@ export default class Conversation {
name: string; // engineering, general, arjun, jacob and rachel...
lastActivityDate?: Timestamp; // caching this for purpose of saving on listeners
activeMembers: string[]; // userIds
membersInLiveRoom: string[] = [] as string[]; // all members in a live call right now for this convo
cachedAudioClips: AudioClip[] = [] as AudioClip[];
cachedDrawerItems: Link[] = [] as Link[];
tldrClips: AudioClip[] = [] as AudioClip[];
createdDate: Timestamp = Timestamp.now();
createdByUserId: string;
lastActivityDate?: Timestamp; // caching this for purpose of saving on listeners
membersInLiveRoom: string[] = [] as string[]; // all members in a live call right now for this convo
constructor(_createdByUserId: string, _name: string) {
constructor(
_createdByUserId: string,
_name: string,
_initialUsers: string[] = [] as string[]
) {
this.name = _name;
this.createdByUserId = _createdByUserId;
this.activeMembers = _initialUsers;
}
}
@@ -15,13 +15,15 @@ import Collections from "./collections";
export default class ConversationService {
private db: Firestore = getFirestore();
async test() {
async test(): Promise<boolean> {
const docRef = doc(this.db, "test", "test");
await setDoc(
docRef,
{ hi: " hiii", lastUpdatedDate: serverTimestamp() },
{ merge: true }
);
return false;
}
async createConversation(