File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ export default defineNuxtConfig({
120120 appId : "1:1053765361889:web:feb439fa8220fadf1157a0" ,
121121 measurementId : "G-XJDRX60BNX" ,
122122 } ,
123+ wrappedFunctionsProjectId : local ? "whatsanalyze-wrapped" : "whatsanalyze-wrapped-prod" ,
123124 } ,
124125 } ,
125126
Original file line number Diff line number Diff line change @@ -28,7 +28,23 @@ export default defineNuxtPlugin(() => {
2828 "wrapped"
2929 ) ;
3030 wrappedFirestore = getFirestore ( wrappedApp ) ;
31- wrappedFunctions = getFunctions ( wrappedApp ) ;
31+
32+ if (
33+ config . public . wrappedFunctionsProjectId &&
34+ config . public . wrappedFunctionsProjectId !==
35+ config . public . wrappedFirebase . projectId
36+ ) {
37+ const functionsApp = initializeApp (
38+ {
39+ ...config . public . wrappedFirebase ,
40+ projectId : config . public . wrappedFunctionsProjectId ,
41+ } ,
42+ "wrapped-functions"
43+ ) ;
44+ wrappedFunctions = getFunctions ( functionsApp ) ;
45+ } else {
46+ wrappedFunctions = getFunctions ( wrappedApp ) ;
47+ }
3248 } catch ( e ) {
3349 console . warn ( "Wrapped Firebase initialization:" , e ) ;
3450 }
You can’t perform that action at this time.
0 commit comments