@umituz/react-native-firebase 1.13.124 → 1.13.125
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-firebase",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.125",
|
|
4
4
|
"description": "Unified Firebase package for React Native apps - Auth and Firestore services using Firebase JS SDK (no native modules).",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
package/src/firestore/index.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { Firestore } from "../../infrastructure/config/FirestoreClient";
|
|
7
|
-
import {
|
|
7
|
+
import { getFirestore } from "../../infrastructure/config/FirestoreClient";
|
|
8
8
|
import type { FirestoreResult } from "../result/result.util";
|
|
9
9
|
import { NO_DB_ERROR } from "../result/result.util";
|
|
10
10
|
|
|
@@ -15,7 +15,7 @@ import { NO_DB_ERROR } from "../result/result.util";
|
|
|
15
15
|
export async function withFirestore<T>(
|
|
16
16
|
operation: (db: Firestore) => Promise<FirestoreResult<T>>,
|
|
17
17
|
): Promise<FirestoreResult<T>> {
|
|
18
|
-
const db =
|
|
18
|
+
const db = getFirestore();
|
|
19
19
|
if (!db) {
|
|
20
20
|
return NO_DB_ERROR as FirestoreResult<T>;
|
|
21
21
|
}
|
|
@@ -28,7 +28,7 @@ export async function withFirestore<T>(
|
|
|
28
28
|
export async function withFirestoreVoid(
|
|
29
29
|
operation: (db: Firestore) => Promise<void>,
|
|
30
30
|
): Promise<void> {
|
|
31
|
-
const db =
|
|
31
|
+
const db = getFirestore();
|
|
32
32
|
if (!db) {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
@@ -41,7 +41,7 @@ export async function withFirestoreVoid(
|
|
|
41
41
|
export async function withFirestoreBool(
|
|
42
42
|
operation: (db: Firestore) => Promise<boolean>,
|
|
43
43
|
): Promise<boolean> {
|
|
44
|
-
const db =
|
|
44
|
+
const db = getFirestore();
|
|
45
45
|
if (!db) {
|
|
46
46
|
return false;
|
|
47
47
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
serverTimestamp as fbServerTimestamp,
|
|
9
9
|
type Transaction,
|
|
10
10
|
} from "firebase/firestore";
|
|
11
|
-
import {
|
|
11
|
+
import { getFirestore } from "../../infrastructure/config/FirestoreClient";
|
|
12
12
|
import type { Firestore } from "../../infrastructure/config/FirestoreClient";
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -18,7 +18,7 @@ import type { Firestore } from "../../infrastructure/config/FirestoreClient";
|
|
|
18
18
|
export async function runTransaction<T>(
|
|
19
19
|
updateFunction: (transaction: Transaction) => Promise<T>
|
|
20
20
|
): Promise<T> {
|
|
21
|
-
const db =
|
|
21
|
+
const db = getFirestore();
|
|
22
22
|
if (!db) {
|
|
23
23
|
throw new Error("[runTransaction] Firestore database is not initialized. Please ensure Firebase is properly initialized before running transactions.");
|
|
24
24
|
}
|