Skip to content

Commit

Permalink
[DUOS-431][risk=no] Handle upload DAA error (#193)
Browse files Browse the repository at this point in the history
* check for undefined, handle page refresh bug
  • Loading branch information
rushtong authored Aug 29, 2019
1 parent 185d783 commit 0fbdc27
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pages/ResearcherProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ReactTooltip from 'react-tooltip';
import { YesNoRadioGroup } from '../components/YesNoRadioGroup';
import { Config } from '../libs/config';
import * as qs from 'query-string';
import _ from 'lodash';

export const ResearcherProfile = hh(class ResearcherProfile extends Component {

Expand Down Expand Up @@ -461,7 +462,8 @@ export const ResearcherProfile = hh(class ResearcherProfile extends Component {

} else {
if (this.state.file !== undefined && this.state.file.name !== '') {
DAR.postDAA(this.state.file.name, this.state.file, profile.urlDAA).then(response => {
const existentDAAUrl = _.isNil(profile.urlDAA) ? '' : profile.urlDAA;
DAR.postDAA(this.state.file.name, this.state.file, existentDAAUrl).then(response => {
profile.urlDAA = response.urlDAA;
profile.nameDAA = response.nameDAA;
this.updateResearcher(profile);
Expand Down Expand Up @@ -1027,7 +1029,7 @@ export const ResearcherProfile = hh(class ResearcherProfile extends Component {
]),

div({ className: "col-lg-12 col-md-12 col-sm-12 col-xs-12" }, [
button({ className: "fileUpload col-lg-4 col-md-4 col-sm-6 col-xs-12 btn-secondary btn-download-pdf hover-color" }, [
div({ style: { paddingTop: 7 }, className: "fileUpload col-lg-4 col-md-4 col-sm-6 col-xs-12 btn-secondary btn-download-pdf hover-color" }, [
span({ className: "glyphicon glyphicon-upload" }),
"Upload S.O. Signed Agreement",
input({ id: "uploadFile", type: "file", onChange: this.handleFileChange, className: "upload" })
Expand Down

0 comments on commit 0fbdc27

Please sign in to comment.