Skip to content

Commit

Permalink
Fixed eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
pvm-code committed Oct 22, 2024
1 parent 19951f9 commit f4b634e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/shared/utils/firebase.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable promise/always-return */
import firebase from "firebase/compat/app";
import "firebase/compat/auth";
import "firebase/compat/firestore";
Expand Down Expand Up @@ -34,6 +33,7 @@ function enableUnlimitedCachePersistence(): Promise<void> {
.enablePersistence({ synchronizeTabs: true }) // Enable persistence
.then(() => {
console.log("Persistence enabled successfully.");
return;
})
.catch(handlePersistenceError); // Handle errors
}
Expand Down Expand Up @@ -70,6 +70,7 @@ function reinitializeFirestoreWithPersistence() {
})
.then(() => {
console.log("Persistence re-enabled.");
return;
})
.catch(handlePersistenceError); // Handle any errors during reinitialization
}
Expand All @@ -89,6 +90,7 @@ export function clearFirestoreCache() {
console.log("Cache cleared successfully.");
reinitializeFirestoreWithPersistence(); // Reinitialize Firestore
window.location.reload(); // Reload page to apply changes
return;
})
.catch((err) => {
if (err.code === "failed-precondition") {
Expand All @@ -104,6 +106,7 @@ enableUnlimitedCachePersistence()
.then(() => {
console.log("Firestore persistence setup complete.");
// You can now safely access Firestore (db) or perform any Firestore operations
return;
})
.catch(() => {
console.log("Firestore persistence setup error.");
Expand Down

0 comments on commit f4b634e

Please sign in to comment.