Skip to content

Commit

Permalink
Fixes #11
Browse files Browse the repository at this point in the history
  • Loading branch information
raffazizzi committed Sep 8, 2018
1 parent 9d198d9 commit ae078ef
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/containers/HomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const mapDispatchToProps = (dispatch) => {
getCustomization: (url) => {
dispatch(clearState())
dispatch(push('/members'))
dispatch(setLoadingStatus('Obtaining customization ODD...'))
dispatch(setLoadingStatus('1/3 Obtaining customization ODD...'))
dispatch(fetchOdd(url)).then((odd) => {
// 1. Get JSON via OxGarage
dispatch(setLoadingStatus('Importing customization ODD...'))
dispatch(setLoadingStatus('2/3 Importing customization ODD...'))
dispatch(postToOxGarage(odd.xml, oxgarage.compile_json)).then(() => {
dispatch(setLoadingStatus('Importing full specification source...'))
dispatch(setLoadingStatus('3/3 Importing full specification source...'))
// 2. Get p5subset.
// TODO: this is a terrible thing, but there are plans to fix it:
// from next release it will be possible to get p5susbet.json directly from the Vault.
Expand All @@ -29,13 +29,13 @@ const mapDispatchToProps = (dispatch) => {
uploadCustomization: (files) => {
dispatch(clearState())
dispatch(push('/members'))
dispatch(setLoadingStatus('Obtaining customization ODD...'))
dispatch(setLoadingStatus('1/3 Obtaining customization ODD...'))
const reader = new FileReader()
reader.readAsText(files[0])
reader.onload = (e) => {
dispatch(receiveOdd(e.target.result))
// 1. Get JSON via OxGarage
dispatch(setLoadingStatus('Importing customization ODD...'))
dispatch(setLoadingStatus('2/3 Importing customization ODD...'))
const odd = new DOMParser().parseFromString(e.target.result, 'text/xml')
if (odd.getElementsByTagNameNS('http://www.tei-c.org/ns/1.0', 'TEI').length !== 1 ) {
throw Error('This does not appear to be a TEI document.')
Expand All @@ -44,7 +44,7 @@ const mapDispatchToProps = (dispatch) => {
throw Error('ODDs with RELAX NG elements are not supported.')
}
dispatch(postToOxGarage(e.target.result, oxgarage.compile_json)).then(() => {
dispatch(setLoadingStatus('Importing full specification source...'))
dispatch(setLoadingStatus('3/3 Importing full specification source...'))
// 2. Get p5subset.
// TODO: this is a terrible thing, but there are plans to fix it:
// from next release it will be possible to get p5susbet.json directly from the Vault.
Expand Down

0 comments on commit ae078ef

Please sign in to comment.