Skip to content

Commit fef3ef0

Browse files
add chat preparation function to handle user switching
1 parent 5946026 commit fef3ef0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

assets/js/chat.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
let db = firebase.firestore();
22
let auth = firebase.auth();
33

4+
// TODO: transition from account.html recent contacts to chat.html not working;
5+
function prepareChat() {
6+
const userID = getQueryParam('action');
7+
if (userID) {
8+
handleSwitchChat(userID);
9+
switchUserChat(userID);
10+
}
11+
}
12+
413
document.addEventListener('DOMContentLoaded', function () {
514
const auth = firebase.auth();
615
const db = firebase.firestore();

chat.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<script src="assets/js/firebase_init.js"></script>
4242
</head>
4343

44-
<body class="bg-gray-100">
44+
<body class="bg-gray-100" onload="prepareChat()">
4545
<div class="container mx-auto p-4">
4646
<div class="flex justify-between items-center border-b-2 border-black pb-2">
4747
<div class="flex space-x-4">

0 commit comments

Comments
 (0)