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