@sirendesign/markup 1.0.4 → 1.0.6
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/dist/index.esm.js +13 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -12
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37515,19 +37515,18 @@ const useFirebaseSync = () => {
|
|
|
37515
37515
|
|
|
37516
37516
|
const MarkupWidget = ({ config: userConfig, }) => {
|
|
37517
37517
|
var _a;
|
|
37518
|
-
// Initialize Firebase
|
|
37519
|
-
|
|
37520
|
-
|
|
37521
|
-
|
|
37522
|
-
|
|
37523
|
-
|
|
37524
|
-
|
|
37525
|
-
catch (error) {
|
|
37526
|
-
console.error('Failed to initialize Firebase:', error);
|
|
37527
|
-
}
|
|
37518
|
+
// Initialize Firebase synchronously on first render only
|
|
37519
|
+
const initRef = require$$0.useRef(false);
|
|
37520
|
+
if (!initRef.current && (userConfig === null || userConfig === void 0 ? void 0 : userConfig.firebaseConfig) && getApps().length === 0) {
|
|
37521
|
+
try {
|
|
37522
|
+
initializeFirebase(userConfig.firebaseConfig);
|
|
37523
|
+
console.log('Firebase initialized from MarkupWidget config');
|
|
37524
|
+
initRef.current = true;
|
|
37528
37525
|
}
|
|
37529
|
-
|
|
37530
|
-
|
|
37526
|
+
catch (error) {
|
|
37527
|
+
console.error('Failed to initialize Firebase:', error);
|
|
37528
|
+
}
|
|
37529
|
+
}
|
|
37531
37530
|
const { isOpen, setIsOpen, activeTab, setActiveTab, selectedFeedback, setSelectedFeedback, feedbackItems, addFeedbackItem, config, setConfig, reset, isAuthenticated, currentUser, } = useMarkupStore();
|
|
37532
37531
|
// Initialize Firebase sync
|
|
37533
37532
|
useFirebaseSync();
|