Skip to content

Commit

Permalink
Fix for initialising local text search again
Browse files Browse the repository at this point in the history
  • Loading branch information
fgatti675 committed Dec 12, 2024
1 parent dc6d09f commit 0552134
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const localSearchControllerBuilder: FirestoreTextSearchControllerBuilder
if (listeners[path]) {
listeners[path]();
delete listeners[path];
delete indexes[path];
}
}

Expand All @@ -42,9 +43,9 @@ export const localSearchControllerBuilder: FirestoreTextSearchControllerBuilder
currentPath = path;

return new Promise(async (resolve, reject) => {
if (!indexes[path] && collectionProp) {
if (collectionProp) {
console.debug("Init local search controller", path);
const firestore = databaseId ? getFirestore(firebaseApp, databaseId): getFirestore(firebaseApp);
const firestore = databaseId ? getFirestore(firebaseApp, databaseId) : getFirestore(firebaseApp);
const col = collection(firestore, path);
listeners[path] = onSnapshot(query(col),
{
Expand Down

0 comments on commit 0552134

Please sign in to comment.