Plugin Directory

Changeset 3219475


Ignore:
Timestamp:
01/09/2025 08:44:57 AM (15 months ago)
Author:
teamzt
Message:

Fixed some minor socket issues.

Location:
mylivecart
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mylivecart/tags/1.0.3/assets/js/zt-script.js

    r3160724 r3219475  
    141141        }
    142142
    143         const navigateToEListHandler = () => {
    144             try {
    145                 // Construct the redirect URL safely
    146                 if (ztcbl_qv && ztcbl_qv.ztcbl_site_url) {
    147                     const redirectUrl = `${ztcbl_qv.ztcbl_site_url}/events-list`;
    148 
    149                     // Optional: Log for debugging or analytics purposes
    150                     console.log('Navigating to:', redirectUrl);
    151 
    152                     // Perform the redirection
    153                     window.location.href = redirectUrl;
    154                 } else {
    155                     console.error('ztcbl_site_url is not defined.');
    156                 }
    157             } catch (error) {
    158                 // Handle any potential errors gracefully
    159                 console.error('Error during redirection:', error);
    160             } finally {
    161                 // Optionally remove the event listener to avoid multiple redirects
    162                 socket.off('navigateToEList', navigateToEListHandler);
    163             }
    164         };
     143        // const navigateToEListHandler = () => {
     144        // try {
     145        //      // Construct the redirect URL safely
     146        //      if (ztcbl_qv && ztcbl_qv.ztcbl_site_url) {
     147        //          const redirectUrl = `${ztcbl_qv.ztcbl_site_url}/events-list`;
     148
     149        //          // Optional: Log for debugging or analytics purposes
     150        //          console.log('Navigating to:', redirectUrl);
     151
     152        //          // Perform the redirection
     153        //          window.location.href = redirectUrl;
     154        //      } else {
     155        //          console.error('ztcbl_site_url is not defined.');
     156        //      }
     157        // } catch (error) {
     158        //      // Handle any potential errors gracefully
     159        //      console.error('Error during redirection:', error);
     160        // } finally {
     161        //      // Optionally remove the event listener to avoid multiple redirects
     162        //      socket.off('navigateToEList', navigateToEListHandler);
     163        // }
     164        // };
    165165
    166166        function connectHighlightedSocket() {
     
    187187
    188188
    189             socket.on('navigateToEList', navigateToEListHandler);
     189            // socket.on('navigateToEList', navigateToEListHandler);
    190190
    191191
  • mylivecart/trunk/assets/js/zt-script.js

    r3160718 r3219475  
    141141        }
    142142
    143         const navigateToEListHandler = () => {
    144             try {
    145                 // Construct the redirect URL safely
    146                 if (ztcbl_qv && ztcbl_qv.ztcbl_site_url) {
    147                     const redirectUrl = `${ztcbl_qv.ztcbl_site_url}/events-list`;
    148 
    149                     // Optional: Log for debugging or analytics purposes
    150                     console.log('Navigating to:', redirectUrl);
    151 
    152                     // Perform the redirection
    153                     window.location.href = redirectUrl;
    154                 } else {
    155                     console.error('ztcbl_site_url is not defined.');
    156                 }
    157             } catch (error) {
    158                 // Handle any potential errors gracefully
    159                 console.error('Error during redirection:', error);
    160             } finally {
    161                 // Optionally remove the event listener to avoid multiple redirects
    162                 socket.off('navigateToEList', navigateToEListHandler);
    163             }
    164         };
     143        // const navigateToEListHandler = () => {
     144        // try {
     145        //      // Construct the redirect URL safely
     146        //      if (ztcbl_qv && ztcbl_qv.ztcbl_site_url) {
     147        //          const redirectUrl = `${ztcbl_qv.ztcbl_site_url}/events-list`;
     148
     149        //          // Optional: Log for debugging or analytics purposes
     150        //          console.log('Navigating to:', redirectUrl);
     151
     152        //          // Perform the redirection
     153        //          window.location.href = redirectUrl;
     154        //      } else {
     155        //          console.error('ztcbl_site_url is not defined.');
     156        //      }
     157        // } catch (error) {
     158        //      // Handle any potential errors gracefully
     159        //      console.error('Error during redirection:', error);
     160        // } finally {
     161        //      // Optionally remove the event listener to avoid multiple redirects
     162        //      socket.off('navigateToEList', navigateToEListHandler);
     163        // }
     164        // };
    165165
    166166        function connectHighlightedSocket() {
     
    187187
    188188
    189             socket.on('navigateToEList', navigateToEListHandler);
     189            // socket.on('navigateToEList', navigateToEListHandler);
    190190
    191191
Note: See TracChangeset for help on using the changeset viewer.