receiveIframeMessage(e) {
    const data = iframeMsgDataExtraction(e);

    // try to auto-correct for currentPattern data that doesn't always match with url
    // workaround for certain pages (especially view all pages) not always matching up internally with the expected current pattern key
    if (data.event !== undefined && data.event === 'patternLab.pageLoad') {
      try {
        const currentPattern =
          this.sanitizePatternName(data.patternpartial) ||
          this.getPatternParam();

        document.title = 'Pattern Lab - ' + currentPattern;

        const addressReplacement =
          window.location.protocol === 'file:'
            ? null
            : window.location.protocol +
              '//' +
              window.location.host +
              window.location.pathname.replace('index.html', '') +
              '?p=' +
              currentPattern;

        window.history.replaceState(
          {
            currentPattern: currentPattern,
          },
          null,
          addressReplacement
        );

        const currentUrl = urlHandler.getFileName(currentPattern);
        if (currentUrl) {
          store.dispatch(updateCurrentUrl(currentUrl));
        }
        store.dispatch(updateCurrentPattern(currentPattern));
      } catch (error) {
        console.log(error);
      }
    }
  }
/**
   * updates the nav after the iframed page tells the iframe it's done loading
   *
   * @param {MessageEvent} e A message received by a target object.
   */
updates the nav after the iframed page tells the iframe it's done loading
@param {MessageEvent} e A message received by a target object.
updates the nav after the iframed page tells the iframe it ' s done loading @param { MessageEvent } e A message received by a target object .
receiveIframeMessage(e) {
    const data = iframeMsgDataExtraction(e);
    if (data.event !== undefined && data.event === 'patternLab.pageLoad') {
      try {
        const currentPattern =
          this.sanitizePatternName(data.patternpartial) ||
          this.getPatternParam();
        document.title = 'Pattern Lab - ' + currentPattern;
        const addressReplacement =
          window.location.protocol === 'file:'
            ? null
            : window.location.protocol +
              '//' +
              window.location.host +
              window.location.pathname.replace('index.html', '') +
              '?p=' +
              currentPattern;
        window.history.replaceState(
          {
            currentPattern: currentPattern,
          },
          null,
          addressReplacement
        );
        const currentUrl = urlHandler.getFileName(currentPattern);
        if (currentUrl) {
          store.dispatch(updateCurrentUrl(currentUrl));
        }
        store.dispatch(updateCurrentPattern(currentPattern));
      } catch (error) {
        console.log(error);
      }
    }
  }
receiveIframeMessage ( e ) { const data = iframeMsgDataExtraction ( e ) ; if ( data . event !== undefined && data . event === 'patternLab.pageLoad' ) { try { const currentPattern = this . sanitizePatternName ( data . patternpartial ) || this . getPatternParam ( ) ; document . title = 'Pattern Lab - ' + currentPattern ; const addressReplacement = window . location . protocol === 'file:' ? null : window . location . protocol + '//' + window . location . host + window . location . pathname . replace ( 'index.html' , '' ) + '?p=' + currentPattern ; window . history . replaceState ( { currentPattern : currentPattern , } , null , addressReplacement ) ; const currentUrl = urlHandler . getFileName ( currentPattern ) ; if ( currentUrl ) { store . dispatch ( updateCurrentUrl ( currentUrl ) ) ; } store . dispatch ( updateCurrentPattern ( currentPattern ) ) ; } catch ( error ) { console . log ( error ) ; } } }
updates the nav after the iframed page tells the iframe it's done loading
 @param {MessageEvent} e A message received by a target object.
updates the nav after the iframed page tells the iframe it ' s done loading @param { MessageEvent } e A message received by a target object .
// try to auto-correct for currentPattern data that doesn't always match with url // workaround for certain pages (especially view all pages) not always matching up internally with the expected current pattern key