From 61e782c6b7d665f88c93f7186affa8323ab910dc Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Wed, 18 Dec 2024 12:57:56 +0000 Subject: [PATCH] fix: proxy behavior --- packages/app/lib/common/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/app/lib/common/index.js b/packages/app/lib/common/index.js index b1f4eebe73..159ae0c40f 100644 --- a/packages/app/lib/common/index.js +++ b/packages/app/lib/common/index.js @@ -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') { @@ -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') {