@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.js CHANGED
@@ -37515,19 +37515,18 @@ const useFirebaseSync = () => {
37515
37515
 
37516
37516
  const MarkupWidget = ({ config: userConfig, }) => {
37517
37517
  var _a;
37518
- // Initialize Firebase BEFORE any hooks run (using useMemo ensures this happens first)
37519
- useMemo(() => {
37520
- if ((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
- }
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
- return null;
37530
- }, [userConfig === null || userConfig === void 0 ? void 0 : userConfig.firebaseConfig]);
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();