esoftplay-event 0.0.2-a → 0.0.2-b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/event/firebase_socket.ts +13 -11
- package/package.json +1 -1
package/event/firebase_socket.ts
CHANGED
|
@@ -117,7 +117,7 @@ export default function useFirebaseSocket() {
|
|
|
117
117
|
return
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
if (userIdKeyReplacer.get()?.priority == 1) {
|
|
120
|
+
if (userIdKeyReplacer.get()?.priority == 1 && userIdKeyReplacer.get()?.t) {
|
|
121
121
|
const coll = collection(db, [getEventPath(), path, event_id].join('/'));
|
|
122
122
|
const q = query(coll, orderBy('t', 'asc'), where("t", "==", userIdKeyReplacer.get().t));
|
|
123
123
|
getDocs(q).then((doc) => {
|
|
@@ -168,17 +168,19 @@ export default function useFirebaseSocket() {
|
|
|
168
168
|
// get weather function
|
|
169
169
|
|
|
170
170
|
function getQueue(path: string, event_id: string, _limit: number, cb: (idx: number, key: string) => void) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
if (userIdKeyReplacer.get()?.s) {
|
|
172
|
+
const instance: any = esp.mod("firestore/index")().instance()
|
|
173
|
+
const db = getFirestore(instance)
|
|
174
|
+
const coll = collection(db, [getEventPath(), path, event_id].join('/'));
|
|
175
|
+
const q = query(coll, orderBy('s', 'asc'), where("s", "<", userIdKeyReplacer.get().s));
|
|
176
|
+
getCountFromServer(q).then((v) => {
|
|
177
|
+
cb(v.data().count, userIdKeyReplacer.get().id)
|
|
178
|
+
}).catch((e) => {
|
|
179
|
+
getQueue(path, event_id, _limit, cb)
|
|
180
|
+
console.log({ e })
|
|
181
|
+
})
|
|
182
|
+
}
|
|
175
183
|
|
|
176
|
-
getCountFromServer(q).then((v) => {
|
|
177
|
-
cb(v.data().count, userIdKeyReplacer.get().id)
|
|
178
|
-
}).catch((e) => {
|
|
179
|
-
getQueue(path, event_id, _limit, cb)
|
|
180
|
-
console.log({ e })
|
|
181
|
-
})
|
|
182
184
|
// /* cleanup */
|
|
183
185
|
// const cdate = getDateTimebyGmt7().getTime()
|
|
184
186
|
// if (!cdate) {
|