@@ -46,63 +46,63 @@ export interface ChatRoom {
4646 } ;
4747}
4848
49- // Create default chat rooms if they don't exist
50- export const initializeDefaultChatRooms = async ( ) => {
51- try {
52- // Check if main chat room exists
53- const mainRoomRef = doc ( db , 'rooms' , 'main' ) ;
54- const mainRoomDoc = await getDoc ( mainRoomRef ) ;
49+ // // Create default chat rooms if they don't exist
50+ // export const initializeDefaultChatRooms = async () => {
51+ // try {
52+ // // Check if main chat room exists
53+ // const mainRoomRef = doc(db, 'rooms', 'main');
54+ // const mainRoomDoc = await getDoc(mainRoomRef);
5555
56- if ( ! mainRoomDoc . exists ( ) ) {
57- // Create main chat room
58- await setDoc ( mainRoomRef , {
59- name : "Main Chat" ,
60- participants : [ ] ,
61- createdAt : serverTimestamp ( ) ,
62- createdBy : 'system' ,
63- type : 'main'
64- } ) ;
65- console . log ( "Main chat room created" ) ;
66- }
56+ // if (!mainRoomDoc.exists()) {
57+ // // Create main chat room
58+ // await setDoc(mainRoomRef, {
59+ // name: "Main Chat",
60+ // participants: [],
61+ // createdAt: serverTimestamp(),
62+ // createdBy: 'system',
63+ // type: 'main'
64+ // });
65+ // console.log("Main chat room created");
66+ // }
6767
68- // Check if men's chat room exists
69- const menRoomRef = doc ( db , 'rooms' , 'men' ) ;
70- const menRoomDoc = await getDoc ( menRoomRef ) ;
68+ // // Check if men's chat room exists
69+ // const menRoomRef = doc(db, 'rooms', 'men');
70+ // const menRoomDoc = await getDoc(menRoomRef);
7171
72- if ( ! menRoomDoc . exists ( ) ) {
73- // Create men's chat room
74- await setDoc ( menRoomRef , {
75- name : "Men's Chat" ,
76- participants : [ ] ,
77- createdAt : serverTimestamp ( ) ,
78- createdBy : 'system' ,
79- type : 'men'
80- } ) ;
81- console . log ( "Men's chat room created" ) ;
82- }
72+ // if (!menRoomDoc.exists()) {
73+ // // Create men's chat room
74+ // await setDoc(menRoomRef, {
75+ // name: "Men's Chat",
76+ // participants: [],
77+ // createdAt: serverTimestamp(),
78+ // createdBy: 'system',
79+ // type: 'men'
80+ // });
81+ // console.log("Men's chat room created");
82+ // }
8383
84- // Check if women's chat room exists
85- const womenRoomRef = doc ( db , 'rooms' , 'women' ) ;
86- const womenRoomDoc = await getDoc ( womenRoomRef ) ;
84+ // // Check if women's chat room exists
85+ // const womenRoomRef = doc(db, 'rooms', 'women');
86+ // const womenRoomDoc = await getDoc(womenRoomRef);
8787
88- if ( ! womenRoomDoc . exists ( ) ) {
89- // Create women's chat room
90- await setDoc ( womenRoomRef , {
91- name : "Women's Chat" ,
92- participants : [ ] ,
93- createdAt : serverTimestamp ( ) ,
94- createdBy : 'system' ,
95- type : 'women'
96- } ) ;
97- console . log ( "Women's chat room created" ) ;
98- }
88+ // if (!womenRoomDoc.exists()) {
89+ // // Create women's chat room
90+ // await setDoc(womenRoomRef, {
91+ // name: "Women's Chat",
92+ // participants: [],
93+ // createdAt: serverTimestamp(),
94+ // createdBy: 'system',
95+ // type: 'women'
96+ // });
97+ // console.log("Women's chat room created");
98+ // }
9999
100- return true ;
101- } catch ( error ) {
102- console . error ( "Error initializing default chat rooms:" , error ) ;
103- return false ;
104- }
105- } ;
100+ // return true;
101+ // } catch (error) {
102+ // console.error("Error initializing default chat rooms:", error);
103+ // return false;
104+ // }
105+ // };
106106
107107// Get available chat rooms for a user based on their gender
108108export const getAvailableRooms = ( userId : string , gender ?: string ) => {
0 commit comments