@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.esm.js
CHANGED
|
@@ -37511,17 +37511,19 @@ const useFirebaseSync = () => {
|
|
|
37511
37511
|
|
|
37512
37512
|
const MarkupWidget = ({ config: userConfig, }) => {
|
|
37513
37513
|
var _a;
|
|
37514
|
-
|
|
37515
|
-
|
|
37516
|
-
if ((userConfig === null || userConfig === void 0 ? void 0 : userConfig.firebaseConfig) && getApps().length === 0) {
|
|
37514
|
+
// Initialize Firebase synchronously on first render only
|
|
37515
|
+
const initRef = useRef(false);
|
|
37516
|
+
if (!initRef.current && (userConfig === null || userConfig === void 0 ? void 0 : userConfig.firebaseConfig) && getApps().length === 0) {
|
|
37517
37517
|
try {
|
|
37518
37518
|
initializeFirebase(userConfig.firebaseConfig);
|
|
37519
37519
|
console.log('Firebase initialized from MarkupWidget config');
|
|
37520
|
+
initRef.current = true;
|
|
37520
37521
|
}
|
|
37521
37522
|
catch (error) {
|
|
37522
37523
|
console.error('Failed to initialize Firebase:', error);
|
|
37523
37524
|
}
|
|
37524
37525
|
}
|
|
37526
|
+
const { isOpen, setIsOpen, activeTab, setActiveTab, selectedFeedback, setSelectedFeedback, feedbackItems, addFeedbackItem, config, setConfig, reset, isAuthenticated, currentUser, } = useMarkupStore();
|
|
37525
37527
|
// Initialize Firebase sync
|
|
37526
37528
|
useFirebaseSync();
|
|
37527
37529
|
useEffect(() => {
|