Skip to content

Commit

Permalink
fix: proxy behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley committed Dec 18, 2024
1 parent f253290 commit 61e782c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/app/lib/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,12 @@ export function createDeprecationProxy(instance) {
const originalMethod = target[prop];

if (prop === 'constructor') {
return target.constructor;
return Reflect.get(target, prop, receiver);
}

if (target && target.constructor && target.constructor.name === 'FirestoreTimestamp') {
deprecationConsoleWarning('firestore', prop, 'FirestoreTimestamp', false);
return Reflect.get(target, prop, receiver);
}

if (target && target.name === 'firebaseModuleWithApp') {
Expand All @@ -308,7 +309,10 @@ export function createDeprecationProxy(instance) {
) {
deprecationConsoleWarning('firestore', prop, 'statics', false);
}
return target[prop];
if (prop !== 'setLogLevel') {
// we want to capture setLogLevel function call which we do below
return Reflect.get(target, prop, receiver);
}
}

if (typeof originalMethod === 'function') {
Expand Down

0 comments on commit 61e782c

Please sign in to comment.