Skip to content

Commit 708e8b3

Browse files
committed
fix: corrections
1 parent e0e993b commit 708e8b3

2 files changed

Lines changed: 3 additions & 13 deletions

File tree

packages/database/e2e/snapshot/snapshot.e2e.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,6 @@ describe('database()...snapshot', function () {
415415
});
416416

417417
it('forEach works with objects and cancels when returning true', async function () {
418-
// @ts-ignore
419-
globalThis.RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS = true;
420418
const { getDatabase, ref, child, orderByKey, query, get } = databaseModular;
421419

422420
const callback = sinon.spy();
@@ -432,8 +430,6 @@ describe('database()...snapshot', function () {
432430
});
433431

434432
callback.should.be.calledOnce();
435-
// @ts-ignore
436-
globalThis.RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS = false;
437433
});
438434

439435
it('forEach works with arrays and cancels when returning true', async function () {
@@ -471,8 +467,6 @@ describe('database()...snapshot', function () {
471467
});
472468

473469
it('forEach cancels iteration when returning true', async function () {
474-
// @ts-ignore
475-
globalThis.RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS = true;
476470
const { getDatabase, ref, child, orderByValue, query, get } = databaseModular;
477471

478472
const callback = sinon.spy();
@@ -488,8 +482,6 @@ describe('database()...snapshot', function () {
488482
cancelled.should.equal(true);
489483
callback.should.be.callCount(1);
490484
callback.getCall(0).args[0].should.equal(0);
491-
// @ts-ignore
492-
globalThis.RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS = false;
493485
});
494486

495487
it('getPriority returns the correct value', async function () {

packages/database/lib/DatabaseSyncTree.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*/
1717

18-
import { isString, createDeprecationProxy } from '@react-native-firebase/app/lib/common';
18+
import { isString } from '@react-native-firebase/app/lib/common';
1919
import { getReactNativeModule } from '@react-native-firebase/app/lib/internal/nativeModule';
2020
import NativeError from '@react-native-firebase/app/lib/internal/NativeFirebaseError';
2121
import SharedEventEmitter from '@react-native-firebase/app/lib/internal/SharedEventEmitter';
@@ -119,11 +119,9 @@ class DatabaseSyncTree {
119119

120120
// Value events don't return a previousChildName
121121
if (event.eventType === 'value') {
122-
snapshot = createDeprecationProxy(new DatabaseDataSnapshot(registration.ref, event.data));
122+
snapshot = new DatabaseDataSnapshot(registration.ref, event.data);
123123
} else {
124-
snapshot = createDeprecationProxy(
125-
new DatabaseDataSnapshot(registration.ref, event.data.snapshot),
126-
);
124+
snapshot = new DatabaseDataSnapshot(registration.ref, event.data.snapshot);
127125
previousChildName = event.data.previousChildName;
128126
}
129127

0 commit comments

Comments
 (0)