updateEditor = () => {
        if (playgroundState.get('autoGenerate')) {
          if (initialWorkspaceJson && isFirstLoad) {
            isFirstLoad = false;
            try {
              Blockly.serialization.workspaces.load(
                JSON.parse(initialWorkspaceJson),
                workspace,
              );
            } catch (e) {
              console.warn('Failed to auto import.', e);
            }
          }

          if (currentGenerate) {
            currentGenerate();
          }

          let code = '';
          try {
            code = JSON.stringify(
              Blockly.serialization.workspaces.save(workspace),
              null,
              2,
            );
          } catch (e) {
            console.warn('Failed to auto save.', e);
          }
          playgroundState.set('workspaceJson', code);
          playgroundState.save();
        }
      }
Call the current generate method if we are in 'auto' mode. In
addition, persist the current workspace xml regardless of which tab
we are in.