Skip to content

Commit

Permalink
Merge pull request #1609 from Sefaria/bug/sc-20253/unable-to-view-ver…
Browse files Browse the repository at this point in the history
…sions-of-scriptures

fix(reader): hot fix translation bug from gtag
  • Loading branch information
akiva10b authored Aug 27, 2023
2 parents b01943d + 5262c46 commit 27fbf86
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions static/js/VersionBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ class VersionBlock extends Component {
onVersionTitleClick(e) {
e.preventDefault();
this.index = Sefaria.parseRef(this.props.currentRef).index
gtag("event", "onClick_version_title", {element_name: `version_title`, change_to: `${this.props.version.versionTitle}`, change_from: `${this.props.currObjectVersions[this.props.version.language]['versionTitle']}`, categories: `${Sefaria.refCategories(this.props.currentRef)}`, book: `${Sefaria.parseRef(this.props.currentRef).index}` })
try {
gtag("event", "onClick_version_title", {element_name: `version_title`, change_to: `${this.props.version.versionTitle}`, change_from: `${this.props.currObjectVersions[this.props.version.language]['versionTitle']}`, categories: `${Sefaria.refCategories(this.props.currentRef)}`, book: `${Sefaria.parseRef(this.props.currentRef).index}` })
}
catch(err) {
console.log(err);
}
if (!this.props.openVersionInSidebar && !this.props.openVersionInReader) return;
if (this.props.firstSectionRef) {
window.location = `/${this.props.firstSectionRef}?v${this.props.version.language}=${this.props.version.versionTitle.replace(/\s/g,'_')}`;
Expand All @@ -52,9 +57,14 @@ class VersionBlock extends Component {
}
onSelectVersionClick(e) {
e.preventDefault();
gtag("event", "onClick_select_version", {element_name: `select_version`,
change_to: `${this.props.version.versionTitle}`, change_from: `${this.props.currObjectVersions[this.props.version.language]['versionTitle']}`,
categories: `${Sefaria.refCategories(this.props.currentRef)}`, book: `${Sefaria.parseRef(this.props.currentRef).index}` })
try {
gtag("event", "onClick_select_version", {element_name: `select_version`,
change_to: `${this.props.version.versionTitle}`, change_from: `${this.props.currObjectVersions[this.props.version.language]['versionTitle']}`,
categories: `${Sefaria.refCategories(this.props.currentRef)}`, book: `${Sefaria.parseRef(this.props.currentRef).index}` })
}
catch(err) {
console.log(err);
}
if (this.props.openVersionInReader) {
this.props.openVersionInReader(this.props.version.versionTitle, this.props.version.language);
Sefaria.setVersionPreference(this.props.currentRef, this.props.version.versionTitle, this.props.version.language);
Expand Down

0 comments on commit 27fbf86

Please sign in to comment.