adding data listening, user getching and using more of recoil
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user